getFieldNames

Return an array with the field names of a result.

@return array
772120
public function getFieldNames()
    {
        $names = [];

        for ($i = 0; $i < $this->countFields(); $i++) {
            $names[] = $this->getFieldName($i);
        }

        return $names;
    }
710162
public function asArray()
    {
        $fields = [
            '@type' => $this->type(),
            '@key'  => $this->key(),
        ];

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

        return $fields;
    }
645847
protected function getDefaultFields(): array
    {
        $result = [];
        $types = Options::getBasicSearchFieldTypes();

        foreach ($this->searchFields as $field => $properties) {
            if (in_array($properties['type'], $types)) {
                $result[] = $field;
            }
        }

        return $result;
    }
1088723
protected function getFields()
    {
        $fields = [];

        foreach ($this as $k => $v) {
            if (is_string($k) && strpos($k, '_') !== 0) {
                $fields[] = $k;
            }
        }

        foreach ($this->_fields as $k => $v) {
            if (is_string($k)) {
                $fields[] = $k;
            }
        }

        return $fields;
    }
178204
protected static function getAllFields()
    {
        return FieldsValues::construct(
            [
                self::FIELD_UNIQUE_ID,
                self::FIELD_USERNAME,
                self::FIELD_FIRST_NAME,
                self::FIELD_LAST_NAME,
                self::FIELD_FULL_NAME,
                self::FIELD_EMAIL,
                self::FIELD_DESCRIPTION,
                self::FIELD_LOCATION,
                self::FIELD_PROFILE_URL,
                self::FIELD_IMAGE_URL,
                self::FIELD_WEBSITES,
                self::FIELD_VERIFIED_EMAIL,
                self::FIELD_EXTRA
            ]
        );
    }
568351
public function getFileFieldNames()
    {
        $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'];

            if (in_array(
                $field['field']['type'],
                [
                        'file',
                        'image',
                        'filelist',
                        'imagelist'
                    ]
            )
            ) {
                $results[] = $name;
            }
        }

        return $results;
    }
820257
public function listColumns()
    {
        $fieldNames = array();
        $field = NULL;
        while ($field = mysqli_fetch_field($this->getResultId())) {
            $fieldNames[] = $field->name;
        }

        return $fieldNames;
    }
632682
private function getFieldName()
    {
        $environment   = $this->getEnvironment();
        $inputProvider = $environment->getInputProvider();

        $fieldName = $inputProvider->hasValue('name') ? $inputProvider->getValue('name') : null;
        if (null === $fieldName) {
            return $fieldName;
        }

        if (('select' !== $inputProvider->getParameter('act'))
            && ('edit' !== $inputProvider->getParameter('mode'))
        ) {
            return $fieldName;
        }

        $dataDefinition = $environment->getDataDefinition();
        $sessionStorage = $environment->getSessionStorage();

        $session = $sessionStorage->get($dataDefinition->getName() . '.' . $inputProvider->getParameter('select'));

        $originalPropertyName = null;
        foreach ($session['models'] as $modelId) {
            if (null !== $originalPropertyName) {
                break;
            }

            $propertyNamePrefix = \str_replace('::', '____', $modelId) . '_';
            if (0 !== strpos($fieldName, $propertyNamePrefix)) {
                continue;
            }

            $originalPropertyName = \substr($fieldName, \strlen($propertyNamePrefix));
        }

        if (!$originalPropertyName) {
            return $fieldName;
        }

        return $originalPropertyName;
    }
510652
protected function getFields(): ?array
    {
        $fields = $this->requestStack->getCurrentRequest()->get('fields');

        if (!is_null($fields)) {
            $fields = array_map('trim', explode(',', $fields));
        }

        return $fields;
    }
111152
public function customFieldsToArray()
    {
        $result = [];
        foreach ($this->getCustomFields() as $field) {
            $result[$field->getInternalFieldName()] = $field->getValue();
        }

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

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

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

        return array_keys($fieldNames);
    }
646716
public function getAllFields()
    {
        $fields = [];
        foreach ($this->fields as $group) {
            foreach ($group as $field) {
                $fields[$field->getName()] = $field;
            }
        }
        return $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;
    }
306728
public function getFieldTypes()
    {
        $fields = [];
        foreach ($this->fields as $name => $value) {
            $fields[$name] = isset($this->types[$name])
                ? $this->types[$name]
                : null
                ;
        }

        return $fields;
    }
8869
protected function getFields() {
        if (!$this->_fields) {
            $this->_fields = new FieldList(
                $this->version,
                $this->solution['assistantSid'],
                $this->solution['sid']
            );
        }

        return $this->_fields;
    }
310001
public function getFields()
    {
        $query_fields = $this->query['fields'] ?? '';
        if ($query_fields === '') {
            return [];
        }

        $special = $this->getSpecialFields();
        foreach ($special as $key => $value) {
            $special[$key] = implode(',', $value);
        }

        $fields = array_filter(explode(',', str_replace(
            array_keys($special),
            $special,
            $query_fields
        )));

        $message = $this->hasFields($fields);
        if ($message !== true) {
            return $message;
        }
        return $fields;
    }