(non-PHPdoc).

@see \Sonata\AdminBundle\Admin\Admin::configureFormFields()
779702
protected function configureFormFields(FormMapper $form)
    {
        if ($this->getSubject() == null || $this->getSubject()->getId() === null) {
            $form->add('path', 'text', array('mapped' => false));
        }
        $form->add('alias', 'text');
        $form->add('title', 'text');
        $form->add('keywords', 'text');
        $form->add('description', 'textarea', array());
        $form->add('metatags', 'textarea', array('label' => 'additional metatags'));
        $form->setHelps(array('metatags' => 'help.metatags'));
    }
1345187
protected function _resolveFields($fields)
    {
        if (is_string($fields)) {
            $fields = [$fields];
        }

        if (!is_array($fields)) {
            throw new Exception('Invalid "fields" configuration.');
        }

        $types = array_keys(Type::map());

        foreach ($fields as $field => $type) {
            if (is_numeric($field) && is_string($type)) {
                unset($fields[$field]);
                $field = $type;
                $type = self::DEFAULT_TYPE;
                $fields[$field] = $type;
            }

            if (!in_array($type, $types)) {
                throw new Exception(sprintf('The field "%s" mapped type "%s" was not found.', $field, $type));
            }
        }

        return $fields;
    }
721112
public function addFields(array $fields)
    {
        $fields = Validate::arrToLower($fields);
        Validate::types(array_values($fields));
        $fields = array_diff_assoc($fields, $this->schema());
        if (!empty($fields))
        {
            $config         = $this->getConfig();
            $config->schema = array_merge($this->schema(), $fields);
            $data = $this->getData();
            foreach ($data as $key => $object)
            {
                foreach($fields as $name => $type)
                    $data[$key]->{$name} = (Validate::isNumeric($type)) ? 0 : null;
            }
            $this->databaseDocument->put($data);
            $this->databaseConfig->put($config);
        }
        return true;
    }
1204313
protected function _deriveFields()
    {
        $config = $this->getConfig();
        $table = $this->_table();

        if (method_exists($table, 'searchConfiguration')) {
            $searchManager = $table->searchConfiguration();
        } else {
            $searchManager = $table->searchManager();
        }

        $fields = [];
        $schema = $table->getSchema();
        $request = $this->_request();

        foreach ($searchManager->getFilters($config['collection']) as $filter) {
            if ($filter->getConfig('form') === false) {
                continue;
            }

            $field = $filter->name();
            $input = [
                'required' => false,
                'type' => 'text'
            ];

            if (substr($field, -3) === '_id' && $field !== '_id') {
                $input['type'] = 'select';
            }

            $filterFormConfig = $filter->getConfig('form');
            if (!empty($filterFormConfig)) {
                $input = $filterFormConfig + $input;
            }

            $input['value'] = $request->getQuery($field);

            if (empty($input['options']) && $schema->getColumnType($field) === 'boolean') {
                $input['options'] = ['No', 'Yes'];
                $input['type'] = 'select';
            }

            if (!empty($input['options'])) {
                $input['empty'] = true;
                if (empty($input['class']) && !$config['selectize']) {
                    $input['class'] = 'no-selectize';
                }

                $fields[$field] = $input;

                continue;
            }

            if (empty($input['class']) && $config['autocomplete']) {
                $input['class'] = 'autocomplete';
            }

            $urlArgs = [];

            $fieldKeys = isset($input['fields']) ? $input['fields'] : ['id' => $field, 'value' => $field];
            if (is_array($fieldKeys)) {
                foreach ($fieldKeys as $key => $val) {
                    $urlArgs[$key] = $val;
                }
            }

            unset($input['fields']);
            $url = array_merge(['action' => 'lookup', '_ext' => 'json'], $urlArgs);
            $input['data-url'] = Router::url($url);

            $fields[$field] = $input;
        }

        return $fields;
    }
870765
public function getCMSFields()
    {
        $fields = $this->scaffoldFormFields(
            array(
                // Don't allow has_many/many_many relationship editing before the record is first saved
                'includeRelations' => ($this->ID > 0),
                'tabbed' => true,
                'ajaxSafe' => true
            )
        );
        $fields->removeByName('PresetID');
        $fields->addFieldToTab(
            'Root.Main',
            ReadonlyField::create(
                'PresetName',
                _t('PlaceableObject.PRESET', 'Preset')
            )->setValue($this->Preset()->Title)
        );
        $this->extend('updateCMSFields', $fields);
        return $fields;
    }
113602
public function fields($fields) {
        if (!is_array($fields)) {
            $fields = func_get_args();
        }

        $this->_fields = $fields;

        return $this;
    }
148276
protected function fieldsToConfig(array $fields)
    {
        $config = [];
        foreach ($fields as $field) {
            $config[$field['name']] = $field['default'];
        }

        return $config;
    }
1021243
public static function registerBuiltinFields()
    {
        $map = [
            'button'         => \Core\Admin\Form\Field\Button::class,
            'checkbox'       => \Core\Admin\Form\Field\Checkbox::class,
            'color'          => \Core\Admin\Form\Field\Color::class,
            'currency'       => \Core\Admin\Form\Field\Currency::class,
            'date'           => \Core\Admin\Form\Field\Date::class,
            'dateRange'      => \Core\Admin\Form\Field\DateRange::class,
            'datetime'       => \Core\Admin\Form\Field\Datetime::class,
            'dateTimeRange'  => \Core\Admin\Form\Field\DatetimeRange::class,
            'datetimeRange'  => \Core\Admin\Form\Field\DatetimeRange::class,
            'decimal'        => \Core\Admin\Form\Field\Decimal::class,
            'display'        => \Core\Admin\Form\Field\Display::class,
            'divider'        => \Core\Admin\Form\Field\Divide::class,
            'divide'         => \Core\Admin\Form\Field\Divide::class,
            'embeds'         => \Core\Admin\Form\Field\Embeds::class,
            'editor'         => \Core\Admin\Form\Field\Editor::class,
            'email'          => \Core\Admin\Form\Field\Email::class,
            'file'           => \Core\Admin\Form\Field\File::class,
            'hasMany'        => \Core\Admin\Form\Field\HasMany::class,
            'hidden'         => \Core\Admin\Form\Field\Hidden::class,
            'id'             => \Core\Admin\Form\Field\Id::class,
            'image'          => \Core\Admin\Form\Field\Image::class,
            'ip'             => \Core\Admin\Form\Field\Ip::class,
            'map'            => \Core\Admin\Form\Field\Map::class,
            'mobile'         => \Core\Admin\Form\Field\Mobile::class,
            'month'          => \Core\Admin\Form\Field\Month::class,
            'multipleSelect' => \Core\Admin\Form\Field\MultipleSelect::class,
            'number'         => \Core\Admin\Form\Field\Number::class,
            'password'       => \Core\Admin\Form\Field\Password::class,
            'radio'          => \Core\Admin\Form\Field\Radio::class,
            'rate'           => \Core\Admin\Form\Field\Rate::class,
            'select'         => \Core\Admin\Form\Field\Select::class,
            'slider'         => \Core\Admin\Form\Field\Slider::class,
            'switch'         => \Core\Admin\Form\Field\SwitchField::class,
            'text'           => \Core\Admin\Form\Field\Text::class,
            'textarea'       => \Core\Admin\Form\Field\Textarea::class,
            'time'           => \Core\Admin\Form\Field\Time::class,
            'timeRange'      => \Core\Admin\Form\Field\TimeRange::class,
            'url'            => \Core\Admin\Form\Field\Url::class,
            'year'           => \Core\Admin\Form\Field\Year::class,
            'html'           => \Core\Admin\Form\Field\Html::class,
            'tags'           => \Core\Admin\Form\Field\Tags::class,
            'icon'           => \Core\Admin\Form\Field\Icon::class,
            'multipleFile'   => \Core\Admin\Form\Field\MultipleFile::class,
            'multipleImage'  => \Core\Admin\Form\Field\MultipleImage::class,
            'captcha'        => \Core\Admin\Form\Field\Captcha::class,
            'listbox'        => \Core\Admin\Form\Field\Listbox::class,
        ];

        foreach ($map as $abstract => $class) {
            static::extend($abstract, $class);
        }
    }
479774
protected function makeConfiguration()
    {
        if ($this->on == 'create' || $this->on == 'update') {
            return $this->fieldName;
        }

        return [
            'field'        => $this->fieldName,
            'trackedField' => $this->trackedFields,
            'value'        => $this->value,
        ];
    }
531733
public function addFields($fields)
    {
        $fieldsArr = $this->parseFields($fields);
        !is_array($this->fields) ? $this->fields = [] : null;
        $this->fields = array_unique(ArrayLib::array_add($this->fields, $fieldsArr));
        return $this;
    }
319580
public static function registerBuiltinFields()
    {
        $map = [
            'button'         => \Ekipisi\Admin\Form\Field\Button::class,
            'checkbox'       => \Ekipisi\Admin\Form\Field\Checkbox::class,
            'color'          => \Ekipisi\Admin\Form\Field\Color::class,
            'currency'       => \Ekipisi\Admin\Form\Field\Currency::class,
            'date'           => \Ekipisi\Admin\Form\Field\Date::class,
            'dateRange'      => \Ekipisi\Admin\Form\Field\DateRange::class,
            'datetime'       => \Ekipisi\Admin\Form\Field\Datetime::class,
            'dateTimeRange'  => \Ekipisi\Admin\Form\Field\DatetimeRange::class,
            'datetimeRange'  => \Ekipisi\Admin\Form\Field\DatetimeRange::class,
            'decimal'        => \Ekipisi\Admin\Form\Field\Decimal::class,
            'display'        => \Ekipisi\Admin\Form\Field\Display::class,
            'divider'        => \Ekipisi\Admin\Form\Field\Divide::class,
            'divide'         => \Ekipisi\Admin\Form\Field\Divide::class,
            'embeds'         => \Ekipisi\Admin\Form\Field\Embeds::class,
            'editor'         => \Ekipisi\Admin\Form\Field\Editor::class,
            'email'          => \Ekipisi\Admin\Form\Field\Email::class,
            'file'           => \Ekipisi\Admin\Form\Field\File::class,
            'hasMany'        => \Ekipisi\Admin\Form\Field\HasMany::class,
            'hidden'         => \Ekipisi\Admin\Form\Field\Hidden::class,
            'id'             => \Ekipisi\Admin\Form\Field\Id::class,
            'image'          => \Ekipisi\Admin\Form\Field\Image::class,
            'ip'             => \Ekipisi\Admin\Form\Field\Ip::class,
            'map'            => \Ekipisi\Admin\Form\Field\Map::class,
            'mobile'         => \Ekipisi\Admin\Form\Field\Mobile::class,
            'month'          => \Ekipisi\Admin\Form\Field\Month::class,
            'multipleSelect' => \Ekipisi\Admin\Form\Field\MultipleSelect::class,
            'number'         => \Ekipisi\Admin\Form\Field\Number::class,
            'password'       => \Ekipisi\Admin\Form\Field\Password::class,
            'radio'          => \Ekipisi\Admin\Form\Field\Radio::class,
            'rate'           => \Ekipisi\Admin\Form\Field\Rate::class,
            'select'         => \Ekipisi\Admin\Form\Field\Select::class,
            'slider'         => \Ekipisi\Admin\Form\Field\Slider::class,
            'switch'         => \Ekipisi\Admin\Form\Field\SwitchField::class,
            'text'           => \Ekipisi\Admin\Form\Field\Text::class,
            'textarea'       => \Ekipisi\Admin\Form\Field\Textarea::class,
            'time'           => \Ekipisi\Admin\Form\Field\Time::class,
            'timeRange'      => \Ekipisi\Admin\Form\Field\TimeRange::class,
            'url'            => \Ekipisi\Admin\Form\Field\Url::class,
            'year'           => \Ekipisi\Admin\Form\Field\Year::class,
            'html'           => \Ekipisi\Admin\Form\Field\Html::class,
            'tags'           => \Ekipisi\Admin\Form\Field\Tags::class,
            'icon'           => \Ekipisi\Admin\Form\Field\Icon::class,
            'multipleFile'   => \Ekipisi\Admin\Form\Field\MultipleFile::class,
            'multipleImage'  => \Ekipisi\Admin\Form\Field\MultipleImage::class,
            'captcha'        => \Ekipisi\Admin\Form\Field\Captcha::class,
            'listbox'        => \Ekipisi\Admin\Form\Field\Listbox::class,
        ];

        foreach ($map as $abstract => $class) {
            static::extend($abstract, $class);
        }
    }
1243711
private static void configureFields(MdcGelfMessageAssembler mdcGelfMessageAssembler, GelfLogField[] fields,
            GelfDynamicMdcLogFields[] dynamicFieldArray) {

    	if (fields == null || fields.length == 0) {
            mdcGelfMessageAssembler.addFields(LogMessageField.getDefaultMapping(Time, Severity, ThreadName, SourceClassName,
                    SourceMethodName, SourceLineNumber, SourceSimpleClassName, LoggerName, Marker));
            return;
        }

        for (GelfLogField field : fields) {

            if (Strings.isNotEmpty(field.getMdc())) {
                mdcGelfMessageAssembler.addField(new MdcMessageField(field.getName(), field.getMdc()));
            }

            if (Strings.isNotEmpty(field.getLiteral())) {
                mdcGelfMessageAssembler.addField(new StaticMessageField(field.getName(), field.getLiteral()));
            }

            if (field.getPatternLayout() != null) {
                mdcGelfMessageAssembler.addField(new PatternLogMessageField(field.getName(), null, field.getPatternLayout()));
            }
        }

        if (dynamicFieldArray != null) {
            for (GelfDynamicMdcLogFields gelfDynamicMdcLogFields : dynamicFieldArray) {
                mdcGelfMessageAssembler.addField(new DynamicMdcMessageField(gelfDynamicMdcLogFields.getRegex()));
            }
        }
    }
1024287
public function setFields($fields = [])
    {
        $existingSchema = $this->get();

        $request = [];
        foreach ($fields as $field) {
            $mode = $this->hasField($field['name'], $existingSchema) ? 'replace-field' : 'add-field';
            $request[$mode][] = $field;
        }

        return $this->request($request);
    }
967870
public function SetField($FieldName) {
      $Config = Gdn::Factory(Gdn::AliasConfig);
      if (is_array($FieldName) === FALSE)
         $FieldName = array($FieldName);

      foreach($FieldName as $Index => $Value) {
         if(is_numeric($Index)) {
            $NameKey = $Value;
            $Default = '';
         } else {
            $NameKey = $Index;
            $Default = $Value;
         }
         /*
         if ($this->Name != 'Configuration')
            $Name = $NameKey;
         else
            $Name = $this->Name.'.'.$NameKey;
         */

         $this->Data[$NameKey] = $Config->Get($NameKey, $Default);
      }
   }
1308915
private void configureCustomFields()
   {
      CustomFieldContainer customFields = m_projectFile.getCustomFields();

      // If the caller hasn't already supplied a value for this field
      if (m_activityIDField == null)
      {
         m_activityIDField = (TaskField) customFields.getFieldByAlias(FieldTypeClass.TASK, "Code");
         if (m_activityIDField == null)
         {
            m_activityIDField = TaskField.WBS;
         }
      }

      // If the caller hasn't already supplied a value for this field
      if (m_activityTypeField == null)
      {
         m_activityTypeField = (TaskField) customFields.getFieldByAlias(FieldTypeClass.TASK, "Activity Type");
      }
   }
364537
private function setCustomFields()
    {
        $customFieldCollection = new CustomFieldCollection();

        if (isset($this->simpleXml->{'custom-fields'})) {
            /** @var SimpleXMLElement $field */
            foreach ($this->simpleXml->{'custom-fields'}->children() as $field) {
                $customField = $this->convertToCustomField($field);
                if (!is_null($customField)) {
                    $customFieldCollection->add($customField);
                }
            }
        }
        $this->customFields = $customFieldCollection;
    }
43059
public function setFields(array $fields)
    {
        $this->checkValidLoader();

        // Flatten
        $this->loaders[ $this->contextLoader ] = [];
        $this->addFields($fields);

        return $this;
    }