public function __construct($code, $class, $baseControllerName) { parent::__construct($code, $class, $baseControllerName); $this->configureFields([[parent::FIELD_KEY => 'name', parent::IDENTIFIER_KEY => true], [parent::FIELD_KEY => 'type', parent::TYPE_KEY => 'sonata_type_choice_field_mask', parent::OPTIONS_KEY => ['choices' => Type::getType('typeCommunityEnumType')->getChoices()], parent::NOT_SHOW_IN_LIST_KEY => true], [parent::FIELD_KEY => 'view', parent::TYPE_KEY => 'sonata_type_choice_field_mask', parent::OPTIONS_KEY => ['choices' => Type::getType('viewCommunityEnumType')->getChoices()], parent::NOT_SHOW_IN_LIST_KEY => true], [parent::FIELD_KEY => 'community', parent::NOT_SHOW_IN_FORM_KEY => true, parent::NOT_SHOW_IN_LIST_KEY => true]]); }
/** * {@inheritdoc} */ protected function addFieldToMapper($mapper, $field) { $type = $this->getFieldType($field); if ($type == 'parent_category') { $class = $this->getClass(); $data = $this->getSubject(); if (method_exists($class, 'getParent')) { $parent = $class::getParent(); $this->addParent($mapper, self::ENTITY_BASE_DIR . $parent, true, $data); } return; } parent::addFieldToMapper($mapper, $field); }
public function getTemplate($name) { return $name == 'edit' ? 'NetworkWebBundle:User:edit.html.twig' : parent::getTemplate($name); }
public function __construct($code, $class, $baseControllerName) { parent::__construct($code, $class, $baseControllerName); $this->configureFields([[parent::FIELD_KEY => 'name', parent::IDENTIFIER_KEY => true], [parent::FIELD_KEY => 'roles', parent::TYPE_KEY => 'collection', parent::OPTIONS_KEY => ['required' => false, 'allow_add' => true, 'allow_delete' => true, 'type' => 'choice', 'options' => ['choices' => Type::getType('roleEnumType')->getChoices()]], parent::NOT_SHOW_IN_LIST_KEY => true]]); }