예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function __construct($code, $class, $baseControllerName)
 {
     parent::__construct($code, $class, $baseControllerName);
     $options = [[parent::FIELD_KEY => 'country', parent::NOT_SHOW_IN_CHILD_KEY => true, parent::OPTIONS_KEY => ['required' => true]]];
     foreach (['city', 'university', 'faculty'] as $f) {
         $options[] = [parent::FIELD_KEY => $f, parent::TYPE_KEY => 'parent_category', parent::NOT_SHOW_IN_CHILD_KEY => true];
     }
     $fields = ['faculties' => 'Faculty', 'chairs' => 'Chair'];
     foreach ($fields as $field => $class) {
         $options[] = [parent::FIELD_KEY => $field, parent::TYPE_KEY => 'sonata_type_model', parent::OPTIONS_KEY => ['class' => 'NetworkStoreBundle:' . $class, 'multiple' => true, 'required' => false, 'by_reference' => false], parent::QUERY => $this->genDQL($class)];
     }
     foreach (['cities', 'universities', 'schools'] as $field) {
         $options[] = [parent::FIELD_KEY => $field, parent::NOT_SHOW_IN_LIST_KEY => true, parent::NOT_SHOW_IN_FORM_KEY => true];
     }
     $this->configureFields($options);
 }
 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]]);
 }
예제 #3
0
 public function __construct($code, $class, $baseControllerName)
 {
     parent::__construct($code, $class, $baseControllerName);
     $this->configureFields([[parent::FIELD_KEY => 'email', parent::IDENTIFIER_KEY => true], [parent::FIELD_KEY => 'plainPassword', parent::NOT_SHOW_IN_LIST_KEY => true, parent::NOT_SHOW_IN_FORM_KEY => true], [parent::FIELD_KEY => 'salt', parent::NOT_SHOW_IN_LIST_KEY => true, parent::NOT_SHOW_IN_FORM_KEY => true], [parent::FIELD_KEY => 'emailCanonical', parent::NOT_SHOW_IN_LIST_KEY => true, parent::NOT_SHOW_IN_FORM_KEY => true], [parent::FIELD_KEY => 'usernameCanonical', parent::NOT_SHOW_IN_LIST_KEY => true, parent::NOT_SHOW_IN_FORM_KEY => true], [parent::FIELD_KEY => 'passwordRequestedAt', parent::NOT_SHOW_IN_LIST_KEY => true, parent::NOT_SHOW_IN_FORM_KEY => true], [parent::FIELD_KEY => 'username', parent::NOT_SHOW_IN_LIST_KEY => true, parent::NOT_SHOW_IN_FORM_KEY => true], [parent::FIELD_KEY => 'lastLogin', parent::NOT_SHOW_IN_LIST_KEY => true, parent::NOT_SHOW_IN_FORM_KEY => true], [parent::FIELD_KEY => 'expiresAt', parent::NOT_SHOW_IN_LIST_KEY => true, parent::NOT_SHOW_IN_FORM_KEY => true], [parent::FIELD_KEY => 'credentialsExpireAt', parent::NOT_SHOW_IN_LIST_KEY => true, parent::NOT_SHOW_IN_FORM_KEY => true], [parent::FIELD_KEY => 'roles', parent::NOT_SHOW_IN_LIST_KEY => true, parent::NOT_SHOW_IN_FORM_KEY => true], [parent::FIELD_KEY => 'confirmationToken', parent::NOT_SHOW_IN_LIST_KEY => true, parent::NOT_SHOW_IN_FORM_KEY => true], [parent::FIELD_KEY => 'enabled', parent::OPTIONS_KEY => ['required' => false]], [parent::FIELD_KEY => 'password', parent::NOT_SHOW_IN_LIST_KEY => true, parent::TYPE_KEY => 'password', parent::EDIT_OPTIONS_KEY => ['required' => false]], [parent::FIELD_KEY => 'gender', parent::TYPE_KEY => 'sonata_type_choice_field_mask', parent::OPTIONS_KEY => ['choices' => Type::getType('genderEnumType')->getChoices()]], [parent::FIELD_KEY => 'birthday', parent::TYPE_KEY => 'date', parent::OPTIONS_KEY => ['required' => false, 'years' => range(date('Y') - 120, date('Y'))]], [parent::FIELD_KEY => 'contactInfo', parent::TYPE_KEY => 'sonata_type_admin', parent::OPTIONS_KEY => ['btn_add' => false, 'delete' => false, 'required' => false], parent::OPTIONS_KEY_DESCRIPTION => ['admin_code' => 'sonata.admin.contact', 'placeholder' => 'No author selected']], [parent::FIELD_KEY => 'jobs', parent::TYPE_KEY => 'collection', parent::OPTIONS_KEY => ['type' => 'job', 'allow_add' => true, 'allow_delete' => true, 'by_reference' => false], parent::NOT_SHOW_IN_LIST_KEY => true, parent::NOT_SHOW_IN_FORM_KEY => true], [parent::FIELD_KEY => 'avatar', parent::TYPE_KEY => 'sonata_media_type', parent::OPTIONS_KEY => ['required' => false, 'provider' => 'sonata.media.provider.image', 'context' => 'avatar']]]);
 }
예제 #4
0
 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]]);
 }