public function buildFormElement(\Symfony\Bundle\FrameworkBundle\Controller\Controller $controller, \Symfony\Component\Form\FormBuilder $builder, \Symforce\AdminBundle\Compiler\Cache\AdminCache $admin, \Symforce\AdminBundle\Compiler\Cache\ActionCache $action, $object, $property_name, $parent_property) { $menu_group = $object->menu_group; if (in_array($property_name, array('image'))) { if (!$menu_group->use_image) { return false; } else { // change the image height, width ? } } parent::buildFormElement($controller, $builder, $admin, $action, $object, $property_name, $parent_property); }