Gets an array of elastic field definitions.

@return array
778052
public function getElasticaFields() {
		$db = \DataObject::database_fields(get_class($this->owner));
		$fields = $this->owner->searchableFields();
		$result = new \ArrayObject();

		foreach ($fields as $name => $params) {
			$type = null;
			$spec = array();

			if (array_key_exists($name, $db)) {
				$class = $db[$name];

				if (($pos = strpos($class, '('))) {
					$class = substr($class, 0, $pos);
				}

				if (array_key_exists($class, self::$mappings)) {
					$spec['type'] = self::$mappings[$class];
				}
			}

			$result[$name] = $spec;
		}
        
        $result['LastEdited'] = array('type' => 'date');
        $result['Created'] = array('type' => 'date');
        $result['ID']       = array('type' => 'integer');

        $result['ParentID'] = array('type' => 'integer');
        $result['Sort'] = array('type' => 'integer');
        
        $result['Name'] = array('type' => 'string');
        $result['MenuTitle'] = array('type' => 'string');
        $result['ShowInSearch'] = array('type' => 'integer');
        
        $result['ClassName'] = array('type' => 'string');
        $result['ClassNameHierarchy'] = array('type' => 'string');

        $result['SS_Stage'] = array('type' => 'keyword');

        $result['PublicView'] = array('type' => 'boolean');

        if ($this->owner->hasExtension('Hierarchy') || $this->owner->hasField('ParentID')) {
            $result['ParentsHierarchy'] = array('type' => 'long',);
        }

        // fix up dates
        foreach ($result as $field => $spec) {
            if (isset($spec['type']) && ($spec['type'] == 'date')) {
                $spec['format'] = 'yyyy-MM-dd HH:mm:ss';
                $result[$field] = $spec;
            }
        }

        if (isset($result['Content']) && count($result['Content'])) {
            $spec = $result['Content'];
            $spec['store'] = false;
            $result['Content'] = $spec;
        }
        $this->owner->invokeWithExtensions('updateElasticMappings', $result);
        
		return $result->getArrayCopy();
	}
398583
public function toArray()
    {
        return [
            'field' => $this->column,
            'references' => $this->references,
            'on' => $this->on,
            'on-delete' => $this->onDelete,
            'on-update' => $this->onUpdate,
            'references-model' => $this->getReferencesModel(),
            'is-self-reference' => $this->isSelfReference(),
        ];
    }
1005375
public function getFields()
	{
		$list	= array();
		foreach( $this->fields as $name => $fields )
				if( count( $fields ) )
					foreach( $fields as $field )
						$list[]	= $field;
		return $list;
	}
204065
public function toArray()
    {
        return [
            'field-changes' => $this->fieldChanges,
            'index-changes' => $this->indexChanges,
            'add-timestamp' => $this->addTimestamps,
            'add-soft-delete' => $this->addSoftDelete,
            'drop-timestamp' => $this->dropTimestamps,
            'drop-soft-delete' => $this->dropSoftDelete,
        ];
    }
172882
public function getFields()
    {
        $coercedFields = [];
        foreach (array_keys($this->entry->getFields()) as $key) {
            $coercedFields[$key] = $this->getCoercedField($key);
        }

        return $coercedFields;
    }
365791
public function getFields()
    {
        $model = $this->getModelInstance();
        $fields = $model->getFillable();
        $filtered_fields = [];

        foreach ($fields as $f) {
            if ($f !== 'password' && $f !== 'Password') {
                $filtered_fields[] = $f;
            }
        }

        return $filtered_fields;
    }
482631
public function toArray()
    {
        $fieldValues = [];
        foreach ($this->fieldsets as $fieldset) {
            $fieldValues = array_merge($fieldValues, $fieldset->toArray());
        }
        return $fieldValues;
    }
583153
public function getElasticSearchClient()
    {
        $config = [];

        if (\Config::has('elasticquent.config')) {
            $config = \Config::get('elasticquent.config');
        }

        return new \Elasticsearch\Client($config);
    }
94862
public function getIndexDefinition()
    {
        return [
            'tag_keywords' => new Search\FieldType\MultipleStringField(),
            'parent_tag_ids' => new Search\FieldType\MultipleIntegerField(),
            'tag_ids' => new Search\FieldType\MultipleIntegerField(),
            'tag_text' => new Search\FieldType\TextField(),
            'fulltext' => new Search\FieldType\FullTextField(),
        ];
    }
246838
public function getContentExtensions()
    {
        $extensions = [];
        foreach ($this->types as $type) {
            $extensions = array_merge($extensions, $type->getExtensions());
        }

        return array_unique($extensions);
    }
41892
public function getTranslatedFields(): array
    {
        return Hash::apply($this->config('fields'), '{*}[searchable=true]', function ($array) {
            $formatted = [];
            foreach ($array as $data) {
                $formatted[$data['name']] = $data['translation'];
            }

            return Hash::sort($formatted, '{s}', 'asc');
        });
    }
298667
public function getValues()
    {
        $contentType = $this->getContenttype();
        if (!isset($contentType['fields'])) {
            return [];
        }

        $allValues = $this->toArray();

        return array_intersect_key($allValues, ($contentType['fields']));
    }
508079
public function getFields()
    {
        $results = [];
        if (!isset($this->data['fields'])
            || empty($this->data['fields'])
        ) {
            return $results;
        }

        $table = $this->data['name'];
        foreach ($this->data['fields'] as $field) {
            $name = $table . '_' . $field['name'];
            $results[$name] = $field;
        }

        return $results;
    }
850613
public function getDefAsArray()
    {
        return array_replace(
            [
                'name'              => $this->getName(),
                'type'              => $this->getType(),
                'exposedName'       => $this->getName(),
                'doctrineType'      => $this->getTypeDoctrine(),
                'serializerType'    => $this->getTypeSerializer(),
                'relType'           => self::REL_TYPE_EMBED,
                'isClassType'       => true,
                'constraints'       => [],
                'required'          => false,
                'searchable'        => 0,
            ],
            $this->definition === null ? [
                'required'          => $this->isRequired()
            ] : [
                'exposedName'       => $this->definition->getExposeAs() ?: $this->getName(),
                'title'             => $this->definition->getTitle(),
                'description'       => $this->definition->getDescription(),
                'readOnly'          => $this->definition->getReadOnly(),
                'required'          => $this->definition->getRequired(),
                'searchable'        => $this->definition->getSearchable(),
                'constraints'       => array_map(
                    [Utils\ConstraintNormalizer::class, 'normalize'],
                    $this->definition->getConstraints()
                ),
            ]
        );
    }
169612
public function getDefinition()
    {
        $definition['KeySchema'] = $this->getDefinitionKeySchema();

        if ($this->isPrimary()) {
            $definition['AttributeDefinitions'] = $this->getDefinitionAttributes();
        } else {
            $definition['IndexName']  = $this->getName();
            $definition['Projection'] = $this->getDefinitionProjection();
        }

        if (!$this->isSecondaryLocal()) {
            $definition['ProvisionedThroughput'] = $this->getDefinitionProvisionedThroughput();
        }

        return $this->isPrimary() ? $definition :
            [$this->getDefinitionIndexType() => $definition];
    }
832091
public function getFieldDefinitions()
    {
        $fields = array();

        $message = $this->checkAccountSettings();
        $accountOk = empty($message);

        // Message fieldset: if account settings have not been filled in.
        if (!$accountOk) {
            $fields['accountSettingsHeader'] = array(
              'type' => 'fieldset',
              'legend' => $this->t('message_error_header'),
              'fields' => array(
                'invoiceMessage' => array(
                  'type' => 'markup',
                  'value' => $message,
                ),
              ),
            );
        }

        // 1st fieldset: Link to config form.
        $fields['configHeader'] = array(
            'type' => 'details',
            'summary' => $this->t('config_form_header'),
            'fields' => $this->getConfigLinkFields(),
        );

        if ($accountOk) {
            $fields += array(
                'tokenHelpHeader' => array(
                    'type' => 'details',
                    'summary' => $this->t('tokenHelpHeader'),
                    'description' => $this->t('desc_tokens'),
                    'fields' => $this->getTokenFields(),
                ),
                'relationSettingsHeader' => array(
                    'type' => 'fieldset',
                    'legend' => $this->t('relationSettingsHeader'),
                    'description' => $this->t('desc_relationSettingsHeader'),
                    'fields' => $this->getRelationFields(),
                ),
                'invoiceSettingsHeader' => array(
                    'type' => 'fieldset',
                    'legend' => $this->t('invoiceSettingsHeader'),
                    'fields' => $this->getInvoiceFields(),
                ),
                'invoiceLinesSettingsHeader' => array(
                    'type' => 'fieldset',
                    'legend' => $this->t('invoiceLinesSettingsHeader'),
                    'fields' => $this->getInvoiceLinesFields(),
                ),
                'optionsSettingsHeader' => array(
                    'type' => 'fieldset',
                    'legend' => $this->t('optionsSettingsHeader'),
                    'description' => $this->t('desc_optionsSettingsHeader'),
                    'fields' => $this->getOptionsFields(),
                ),
                'emailAsPdfSettingsHeader' => array(
                    'type' => 'fieldset',
                    'legend' => $this->t('emailAsPdfSettingsHeader'),
                    'description' => $this->t('desc_emailAsPdfSettings'),
                    'fields' => $this->getEmailAsPdfFields(),
                ),
            );
        }

        $fields += array(
            'versionInformationHeader' => array(
                'type' => 'fieldset',
                'legend' => $this->t('versionInformationHeader'),
                'fields' => $this->getVersionInformation(),
            ),
        );

        return $fields;
    }
178674
public function getFieldNames()
    {
        $fieldNames = $this->_aFieldNames;

        if (!$this->isAdmin() && $this->_blUseLazyLoading) {
            $fieldNames = $this->_getNonCachedFieldNames(true);
        }

        return array_keys($fieldNames);
    }