{@inheritDoc}
@see \rocket\ei\manage\gui\GuiProp::buildGuiField()
340065
public function buildGuiField(Eiu $eiu): ?GuiField {
		$mapping = $eiu->entry()->getEiEntry();
		$eiFrame = $eiu->frame()->getEiFrame();
		$relationEiField = $mapping->getEiField(EiPropPath::from($this));
		$targetReadEiFrame = null;
		
		try {
			$targetReadEiFrame = $this->eiPropRelation->createTargetReadPseudoEiFrame($eiFrame, $mapping);
		} catch (InaccessibleEiCommandPathException $e) {
			return new InaccessibleGuiField($this->getLabelLstr());
		}
		
		$eiPropRelation = $this->eiPropRelation;
		CastUtils::assertTrue($eiPropRelation instanceof SelectEiPropRelation);
		
		$toOneEditable = null;
		if (!$this->eiPropRelation->isReadOnly($mapping, $eiFrame)) {
			$targetEditEiFrame = $this->eiPropRelation->createTargetEditPseudoEiFrame($eiFrame, $mapping);
			$toOneEditable = new ToOneEditable($this->getLabelLstr(), $this->editConfig->isMandatory(),
					$relationEiField, $targetReadEiFrame, $targetEditEiFrame);
			
			$toOneEditable->setSelectOverviewToolsUrl($this->eiPropRelation->buildTargetOverviewToolsUrl(
					$eiFrame, $eiu->frame()->getHttpContext()));
			
			if ($this->eiPropRelation->isEmbeddedAddActivated($eiu->frame()->getEiFrame())
					 && $targetEditEiFrame->getEiExecution()->isGranted()) {
				$toOneEditable->setNewMappingFormUrl($this->eiPropRelation->buildTargetNewEiuEntryFormUrl(
						$mapping, false, $eiFrame, $eiu->frame()->getHttpContext()));
			}
		}
		
		return new ManyToOneGuiField($this->getLabelLstr(), $relationEiField, $targetReadEiFrame, $toOneEditable);		
	}
914042
public function field()
    {
        $yesOption = '<option value="1"'.($this->value === 1 ? ' selected="selected"' : null).'>'.
            trans('panel::global.yes').'</option>';
        $noOption = '<option value="0"'.($this->value === 0 ? ' selected="selected"' : null).'>'.
            trans('panel::global.no').'</option>';

        $input = new HTMLBrick('select', $yesOption.$noOption, [
            'id'   => $this->id,
            'name' => $this->name,
        ]);
        $input->addClass('form-control');

        return $input;
    }
1363594
public function buildForm (FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('username', 'text', array(
                'label' => 'Identifiant'
            ))
            ->add('name', 'text', array(
                'label' => 'Son nom'
            ))
            ->add('email', 'email', array(
                'label' => 'Son email'
            ))
            ->add('plainPassword', 'repeated', array(
                'type' => 'password',
                'first_options'  => array('label' => 'Mot de passe'),
                'second_options' => array('label' => 'Mot de passe (vérification)'),
                'constraints' => array(
                    new NotBlank(),
                    new Length(array(
                        'min' => 6,
                        'max' => 4090,
                        'minMessage' => "Le mot de passe doit faire au moins {{ limit }} caractères",
                        'maxMessage' => "Le mot de passe ne peut pas être plus long que {{ limit }} caractères"
            )))))
            ->add('locked', 'olix_switch', array(
                'label' => 'Bloquage de l\'utilisateur',
                'attr' => array(
                    'data-on-text' => "OUI",
                    'data-off-text' => "NON",
                    'data-on-color' => 'danger',
                    'data-off-color' => 'success',
            )))
            ->add('expiresAt', 'olix_datetimepicker', array(
                'label' => 'Le compte expire le',
                'mapped' => false,
                'format' => 'dd/MM/yyyy HH:mm',
                'config' => array(
                    'pickerPosition' => 'bottom-left',
                    'minuteStep' => 5
            )))
            ->add('groups', 'olix_doublelist_entity', array(
                'label' => 'Groupes',
                'class' => 'OlixSecurityBundle:Group',
                'property' => 'name',
            ))
        ;
    }
711816
public function build($field)
    {
        $return = '';
        if (\is_array($field)) {
            $field = $this->fieldFactory->build($field);
        }
        $this->field = $field;
        $this->props = $field->props;
        $id = $field->getId();
        $isBuilding = \in_array($id, $this->building);
        $uniqueId = $field->getUniqueId(!$isBuilding);
        $this->setIds($uniqueId);
        if (!$isBuilding) {
            $this->building[] = $id;
        }
        $this->addAttributes();
        if (!$isBuilding) {
            $return = $field->doBuild();
        }
        if (!$return) {
            $return = $this->doBuild();
        }
        $return = $this->removeEmptyTags($return);
        $key = \array_search($id, $this->building);
        if ($key !== false) {
            unset($this->building[$key]);
        }
        return $return;
    }
498652
public function cmdGetField()
    {
        $result = $this->getListField();
        $this->outputFormat($result);
        $this->outputFormatTableField($result);
        $this->output();
    }
257723
public function buildContentFieldValue(FormBuilderInterface $builder, FieldInterface $field)
    {
        $builder->add('value', $this->getFormFieldType(), array_merge(
            $this->getDefaultFormFieldValueOptions($field),
            $this->getFormFieldValueOptions($field)
        ));

        $modelTransformer = $this->getValueModelTransformer($field);
        if ($modelTransformer !== null) {
            $builder->get('value')
                ->addModelTransformer($modelTransformer);
        }
    }
778071
public function setField($key, $name, $version = '', array $options = [])
    {
        $field = [
            'name' => $name
        ];

        if (!empty($version)) {
            $field['version'] = $version;
        }

        if (!empty($options)) {
            $field['options'] = $options;
        }

        $this->fields[$key] = $field;

        return $this;
    }
688922
public function buildFields()
    {
        $this->addField('title', 'kuma_menu.menu_item.adminlist.field.title', false, 'KunstmaanMenuBundle:AdminList:menu-item-title.html.twig');
        $this->addField('online', 'kuma_menu.menu_item.adminlist.field.online', false, 'KunstmaanMenuBundle:AdminList:menu-item-online.html.twig');
        $this->addField('type', 'kuma_menu.menu_item.adminlist.field.type', false);
        $this->addField('url', 'kuma_menu.menu_item.adminlist.field.url', false, 'KunstmaanMenuBundle:AdminList:menu-item-url.html.twig');
        $this->addField('newWindow', 'kuma_menu.menu_item.adminlist.field.new_window', false);
    }
1173763
public function withKeyField(string $keyField = null)
    {
        $keyField = $keyField ?: 'key';
        if ($keyField === $this->getKeyField()) {
            return $this;
        }

        $entries = [];
        foreach ($this as $key => $object) {
            // TODO: remove hardcoded logic
            if ($keyField === 'storage_key') {
                $entries[$object->getStorageKey()] = $object;
            } elseif ($keyField === 'flex_key') {
                $entries[$object->getFlexKey()] = $object;
            } elseif ($keyField === 'key') {
                $entries[$object->getKey()] = $object;
            }
        }

        return $this->createFrom($entries, $keyField);
    }
855823
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $fields = AppSettings::settings();
        foreach ($fields as $key => $value) {
            $builder->add($key, TextType::class, [
                'value' => $value,
                'required' => true,
                'constraints' => [ new Symfony\Component\Validator\Constraints\NotBlank()]
            ]);
        }
    }
1305409
public function importField($field)
    {
        if (is_string($field)) {
            $field = $this->model->hasElement($field);
        }
        /** @type \atk4\data\Field $field */

        if (!$field || !$field instanceof \atk4\data\Field) {
            return;
        }

        // prepare name
        $name = $field->short_name;

        // prepare caption
        $caption = isset($field->ui['caption'])
            ? $field->ui['caption']
            : ucwords(str_replace('_', ' ', $name));

        // prepare value
        $value = $field->get();

        // if value is null, then just set empty string as value in template and break out
        if ($value === null) {
            $this->owner->template->setHTML(array($name => '', $name.'-caption' => $caption));
            return;
        }

        // take care of some special data types
        switch ($field->type) {
            case 'boolean':
                if ($value === true || $value === 1 || $value === 'Y') {
                    $value = '<i class="icon-check">&nbsp;'.$this->app->_('yes').'</i>';
                } else {
                    $value = '<i class="icon-check-empty">&nbsp;'.$this->app->_('no').'</i>';
                }
                break;
            case 'date':
                $value = $value->format($this->app->getConfig('locale/date', 'Y-m-d'));
                break;
            case 'datetime':
                $value = $value->format($this->app->getConfig('locale/datetime', 'Y-m-d H:i:s'));
                break;
            case 'time':
                $value = $value->format($this->app->getConfig('locale/time', 'H:i:s'));
                break;
            default:
                $value = $this->model->persistence->typecastsaveField($field, $value);
        }

        // support valueList
        if (isset($field->ui['valueList'][$value])) {
            $value = $field->ui['valueList'][$value];
        }

        // support hasOne
        if ($ref_field = $this->model->hasRef($name)) {
            $m = $ref_field->ref();
            $value = $m->get($m->title_field);
        }

        // fill template
        $data = array($name => $value, $name.'-caption' => $caption);
        $this->owner->template->setHTML($data);
    }
1205228
public function createUiField(PropertyPath $propertyPath, HtmlView $view, UiOutfitter $uiOutfitter): UiComponent {
		return $view->getImport('\rocket\impl\ei\component\prop\relation\view\toManyForm.html',
				array('selectOverviewToolsUrl' => $this->selectOverviewToolsUrl, 
						'newMappingFormUrl' => $this->newMappingFormUrl, 'propertyPath' => $propertyPath));
	}
338167
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);
        $builder->add('title', null, [
                'label'    => 'widget_richlist.form.title.label',
                'required' => true,
            ])
            ->add('description', TextareaType::class, [
                'label'    => 'widget_richlist.form.description.label',
                'required' => true,
            ])
            ->add('kind', null, [
                'label'    => 'widget_richlist.form.kind.label',
                'required' => true,
            ])
            ->add('image', MediaType::class, [
                'label'    => 'widget_richlist.form.image.label',
                'required' => false, ])
            ->add('image2', MediaType::class, [
                'label'    => 'widget_richlist.form.image2.label',
                'required' => false, ])
            ->add('link', LinkType::class)
            ->add('linkLabel', null, [
                'label'    => 'form.widget_richlist.linkLabel.label',
                'required' => false,
            ])
            ->add('linkEnabled', CheckboxType::class, [
                    'label'    => 'form.widget_richlist.linkEnabled.label',
                    'required' => false,
                    'attr'     => [
                        'onchange' => 'linkEnable($vic(this).is(\':checked\']);',
                    ],
            ]);
    }
479314
public function buildForm (FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);
        // Conserve que le champ mot de passe
        foreach (array_keys($builder->all()) as $name) {
            if ($name != 'plainPassword') $builder->remove($name);
        }
    }
546920
protected function fileField(Field $field) : FileFieldBuilder
    {
        return $field->image()->attrs($this->getAll([
            self::ATTR_MIN_WIDTH,
            self::ATTR_MAX_WIDTH,
            self::ATTR_MIN_HEIGHT,
            self::ATTR_MAX_HEIGHT,
        ]));
    }
1015091
public function createUiField(PropertyPath $propertyPath, HtmlView $view, UiOutfitter $uiOutfitter): UiComponent {
		return $view->getImport('\rocket\ei\util\filter\view\filterForm.html', 
				array('propertyPath' => $propertyPath,
						'filterJhtmlHook' => $this->filterJhtmlHook));
	}
1183528
public function build()
    {
        $callback = $this->callback;

        // We will create a new class metadata builder instance,
        // so we can use it to easily generated a new mapping
        // array, without re-declaring the existing field
        $builder = $this->newClassMetadataBuilder();

        $source = $this->convertToMappingArray($this->builder);

        // Create a new field builder for the new class metadata builder,
        // based on the existing (to be overridden) field
        $fieldBuilder = $this->getFieldBuilder(
            $builder,
            $source
        );

        $field = $callback($fieldBuilder);

        // When the user forget to return, use the Field instance
        // which contains the same information
        $field = $field ?: $fieldBuilder;

        if (!$field instanceof Field) {
            throw new InvalidArgumentException('The callback should return an instance of '.Field::class);
        }

        $field->build();

        $target = $this->convertToMappingArray($builder);

        $this->builder->getClassMetadata()->setAttributeOverride(
            $this->name,
            $this->mergeRecursively($source, $target)
        );
    }