access underlying entity in symfony2 form builder

Viewed 1020

I'm looking for a way to access the data class entity in a symfony2 form builder class.

The reason I need this is because the text on the submit button should change depending on a value of this entity (a value the user cannot change in the form).

so basically I want to do:

if ($this->entity->getVariable() == xxx) {
// do something
} else {
// do something else
}

inside the form builder class

2 Answers
Related