Create field-descriptor array.

@return ElasticSearchFieldDescriptor[]
339406
protected function getFieldDescriptors()
    {
        return [
            'uuid' => ElasticSearchFieldDescriptor::create('id', 'public.id')
                ->setDisabled(true)
                ->build(),
            'typeTranslation' => ElasticSearchFieldDescriptor::create('typeTranslation', 'sulu_article.list.type')
                ->setSortField('typeTranslation.raw')
                ->setDisabled(!$this->getParameter('sulu_article.display_tab_all'))
                ->build(),
            'title' => ElasticSearchFieldDescriptor::create('title', 'public.title')
                ->setSortField('title.raw')
                ->build(),
            'creatorFullName' => ElasticSearchFieldDescriptor::create('creatorFullName', 'sulu_article.list.creator')
                ->setSortField('creatorFullName.raw')
                ->build(),
            'changerFullName' => ElasticSearchFieldDescriptor::create('changerFullName', 'sulu_article.list.changer')
                ->setSortField('changerFullName.raw')
                ->build(),
            'authorFullName' => ElasticSearchFieldDescriptor::create('authorFullName', 'sulu_article.author')
                ->setSortField('authorFullName.raw')
                ->build(),
            'created' => ElasticSearchFieldDescriptor::create('created', 'public.created')
                ->setSortField('authored')
                ->setType('datetime')
                ->setDisabled(true)
                ->build(),
            'changed' => ElasticSearchFieldDescriptor::create('changed', 'public.changed')
                ->setSortField('authored')
                ->setType('datetime')
                ->setDisabled(true)
                ->build(),
            'authored' => ElasticSearchFieldDescriptor::create('authored', 'sulu_article.authored')
                ->setSortField('authored')
                ->setType('datetime')
                ->build(),
            'localizationState' => ElasticSearchFieldDescriptor::create('localizationState')
                ->setDisabled(true)
                ->build(),
            'published' => ElasticSearchFieldDescriptor::create('published')
                ->setDisabled(true)
                ->build(),
            'publishedState' => ElasticSearchFieldDescriptor::create('publishedState')
                ->setDisabled(true)
                ->build(),
            'routePath' => ElasticSearchFieldDescriptor::create('routePath')
                ->setDisabled(true)
                ->build(),
        ];
    }
173054
public function fieldNames()
    {
        $fields = [];
        if ($this->l10n()) {
            foreach ($this->translator()->availableLocales() as $langCode) {
                $fields[$langCode] = $this->l10nIdent($langCode);
            }
        } else {
            $fields[] = $this->ident();
        }

        return $fields;
    }
366490
protected function getFieldsAsArrays()
    {
        $fields = [];

        foreach ($this->getFields() as $field) {
            $fields[] = $field->toArray();
        }

        return $fields;
    }
557706
public function getFieldDefinitions()
    {
        $fieldDefinitions = array();
        foreach ($this->fieldDefinitionReferences as $reference) {
            $fieldDefinitions[] = $this->contentTypeService->loadFieldDefinition($reference);
        }

        return $fieldDefinitions;
    }
491267
protected function getCustomfields()
    {
        $extensions = extensions();
        $return     = [];
        event('customfields.before.search', $return);
        event(new BeforeSearch($return));

        foreach ($extensions as $name => $extension) {
            $name   = 'antares/' . str_replace(['component-', 'module-'], '', $extension['name']);
            $config = config($name . '::customfields');
            if (empty($config)) {
                continue;
            }
            if (!$this->validate($config)) {
                continue;
            }

            array_walk($config, function(&$value, $key) {
                if (is_array($value)) {

                    foreach ($value as $index => &$customfield) {
                        if (!class_exists($customfield)) {
                            unset($value[$index]);
                            continue;
                        }
                        $customfield = app($customfield);
                    }
                } else {
                    $value = app($value);
                }
            });

            foreach ($config as $name => $customfields) {
                if (isset($return[$name])) {
                    $return[$name] = array_merge($return[$name], $customfields);
                } else {
                    $return[$name] = $customfields;
                }
            }
        }

        event('customfields.after.search', [$return]);
        event(new AfterSearch($return));
        return $return;
    }
1343933
public function getFields()
    {
        $fields = $this->getInput('fields');

        if (! is_array($fields)) {
            return [];
        }

        return array_map(function ($fields) {
            return explode(',', $fields);
        }, $fields);
    }
492884
private function getFields()
    {
        $fields = [];

        foreach ($this->items as $name => $field) {
            if (is_array($field) && isset($field['name'])) {
                $fields[] = $field['name'];
            } else if ($field instanceof FillableField){
                $fields[] = $field->name;
            } else if (is_string($name)){
                $fields[] = $name;
            } else {
                $fields[] = '';
            }
        }

        return $fields;
    }
172882
public function getFields()
    {
        $coercedFields = [];
        foreach (array_keys($this->entry->getFields()) as $key) {
            $coercedFields[$key] = $this->getCoercedField($key);
        }

        return $coercedFields;
    }
1181904
public function export() : array
    {
        return array_combine(
            $this->keys,
            array_map(function ($f) {
                return $this->getField($f);
            }, $this->keys)
        );
    }
15519
public function getDefAsArray()
    {
        return [
            'length'                => $this->definition->getLength(),
            'title'                 => $this->definition->getTitle(),
            'description'           => $this->definition->getDescription(),
            'readOnly'              => $this->definition->getReadOnly(),
            'hidden'                => $this->definition->getHidden(),
            'recordOriginException' => $this->definition->isRecordOriginException(),
            'required'              => $this->definition->getRequired(),
            'searchable'            => $this->definition->getSearchable(),
            'translatable'          => $this->definition->getTranslatable(),
            'collection'            => $this->definition->getCollection(),
            'groups'                => $this->definition->getGroups(),
            'restrictions'          => $this->definition->getRestrictions(),
            'onVariation'           => $this->definition->getOnVariation(),

            'name'                  => $this->getName(),
            'type'                  => $this->getType(),
            'exposedName'           => $this->getExposedName(),
            'doctrineType'          => $this->getTypeDoctrine(),
            'serializerType'        => $this->getTypeSerializer(),
            'xDynamicKey'           => $this->getXDynamicKey(),
            'relType'               => null,
            'isClassType'           => false,
            'constraints'           => array_map(
                [Utils\ConstraintNormalizer::class, 'normalize'],
                $this->definition->getConstraints()
            ),
        ];
    }
1285549
protected function initAccountContactFieldDescriptors()
    {
        $this->accountContactFieldDescriptors = [];
        $contactJoin = [
            $this->container->getParameter('sulu.model.contact.class') => new DoctrineJoinDescriptor(
                $this->container->getParameter('sulu.model.contact.class'),
                self::$accountContactEntityName . '.contact'
            ),
        ];

        $this->accountContactFieldDescriptors['id'] = new DoctrineFieldDescriptor(
            'id',
            'id',
            self::$accountContactEntityName,
            'contact.contacts.main-contact',
            [],
            FieldDescriptorInterface::VISIBILITY_YES,
            FieldDescriptorInterface::SEARCHABILITY_NEVER,
            '',
            false
        );

        $this->accountContactFieldDescriptors['contactId'] = new DoctrineFieldDescriptor(
            'id',
            'contactId',
            $this->container->getParameter('sulu.model.contact.class'),
            'contact.contacts.main-contact',
            [],
            FieldDescriptorInterface::VISIBILITY_YES,
            FieldDescriptorInterface::SEARCHABILITY_NEVER,
            '',
            false
        );

        $this->accountContactFieldDescriptors['account'] = new DoctrineFieldDescriptor(
            'id',
            'accountId',
            $this->container->getParameter('sulu.model.account.class'),
            '',
            [
                $this->container->getParameter('sulu.model.account.class') => new DoctrineJoinDescriptor(
                    $this->container->getParameter('sulu.model.account.class'),
                    self::$accountContactEntityName . '.account'
                ),
            ]
        );

        $this->accountContactFieldDescriptors['firstName'] = new DoctrineFieldDescriptor(
            'firstName',
            'firstName',
            $this->container->getParameter('sulu.model.contact.class'),
            'contact.contacts.firstname',
            $contactJoin,
            FieldDescriptorInterface::VISIBILITY_YES,
            FieldDescriptorInterface::SEARCHABILITY_NO,
            '',
            false
        );

        $this->accountContactFieldDescriptors['lastName'] = new DoctrineFieldDescriptor(
            'lastName',
            'lastName',
            $this->container->getParameter('sulu.model.contact.class'),
            'contact.contacts.lastName',
            $contactJoin,
            FieldDescriptorInterface::VISIBILITY_YES,
            FieldDescriptorInterface::SEARCHABILITY_NO,
            '',
            false
        );

        $this->accountContactFieldDescriptors['fullName'] = new DoctrineConcatenationFieldDescriptor(
            [
                new DoctrineFieldDescriptor(
                    'firstName',
                    'mainContact',
                    $this->container->getParameter('sulu.model.contact.class'),
                    'contact.contacts.main-contact',
                    $contactJoin
                ),
                new DoctrineFieldDescriptor(
                    'lastName',
                    'mainContact',
                    $this->container->getParameter('sulu.model.contact.class'),
                    'contact.contacts.main-contact',
                    $contactJoin
                ),
            ],
            'fullName',
            'public.name',
            ' ',
            FieldDescriptorInterface::VISIBILITY_ALWAYS,
            FieldDescriptorInterface::SEARCHABILITY_YES,
            '',
            false
        );

        $this->accountContactFieldDescriptors['position'] = new DoctrineFieldDescriptor(
            'position',
            'position',
            self::$positionEntityName,
            'contact.contacts.position',
            [
                self::$positionEntityName => new DoctrineJoinDescriptor(
                    self::$positionEntityName,
                    self::$accountContactEntityName . '.position'
                ),
            ],
            FieldDescriptorInterface::VISIBILITY_ALWAYS,
            FieldDescriptorInterface::SEARCHABILITY_NEVER,
            '',
            false
        );

        // FIXME use field descriptor with expression when implemented
        $this->accountContactFieldDescriptors['isMainContact'] = new DoctrineFieldDescriptor(
            'main',
            'isMainContact',
            self::$accountContactEntityName,
            'contact.contacts.main-contact',
            [],
            FieldDescriptorInterface::VISIBILITY_ALWAYS,
            FieldDescriptorInterface::SEARCHABILITY_NEVER,
            'radio',
            false
        );
    }
776462
public function indexIdentities(): array
    {
        $pkName  = $this->getModelSchemas()->getPrimaryKey($this->getModelClass());
        $builder = $this->createIndexModelBuilder([$pkName]);
        /** @var Generator $data */
        $data   = $this->fetchColumn($builder, $builder->getModelClass(), $pkName);
        $result = iterator_to_array($data);

        return $result;
    }
1164776
public function getFields() {
        if($this->cachedFields == null) {
            $this->cachedFields = $this->createFields();
        }

        return $this->cachedFields;
    }
117257
public function getFields()
    {
        $fields = array_keys($this->fillable);
        if (!empty($fields) && is_integer($fields[0]))
            // only alias provided
            $fields = array_values($this->fillable);

        return array_merge($fields, $this->appends, array_keys($this->attributes));
    }
1107069
private function customFieldsArrayType(): array
    {
        $collectionKeyType = new Type(Type::BUILTIN_TYPE_STRING);
        $collectionValueType = new Type('object', false, CustomFieldInterface::class);

        return [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, $collectionKeyType, $collectionValueType)];
    }
941019
public function getIndexDefinition()
    {
        return array(
            'selected_option_value' => new Search\FieldType\MultipleStringField(),
            'selected_option_index' => new Search\FieldType\MultipleIntegerField(),
            'selected_option_count' => new Search\FieldType\IntegerField(),
            'sort_value' => new Search\FieldType\StringField(),
        );
    }
1260494
private FieldDescriptor[] getExtentFieldDescriptors(TableAlias extAlias, FieldDescriptor[] fds)
    {
        FieldDescriptor[] result = new FieldDescriptor[fds.length];

        for (int i = 0; i < fds.length; i++)
        {
            result[i] = extAlias.cld.getFieldDescriptorByName(fds[i].getAttributeName());
        }

        return result;
    }