Return a fields config array
@return array
197588
private function buildFields()
    {
        $fields = array_map(function($field) {
            return ($field instanceof Builder) ? $field->build() : $field;
        }, $this->getFields());

        return $this->transformFields($fields);
    }
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;
    }
710162
public function asArray()
    {
        $fields = [
            '@type' => $this->type(),
            '@key'  => $this->key(),
        ];

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

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

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

        return $fields;
    }
156034
public function getConfig()
    {
        // Create default keys for the config
        $config = array_merge([
            'width'   => null,
            'height'  => null,
            'options' => null,
        ], $this->config);

        // Add crops
        if ($crop = $this->getAttributeValue('crop_box')) {
            if (!is_array($config['options'])) {
                $config['options'] = [];
            }
            $config['options']['trim_perc'] = [
                round($crop->x1, 4),
                round($crop->y1, 4),
                round($crop->x2, 4),
                round($crop->y2, 4),
            ];
        }

        // Return config
        return $config;
    }
945683
public function getConfigs()
    {
        $configs = [];

        foreach ($this->getConfigFiles() as $file) {
            $name = basename($file->getFilename(), '.php');

            $values = require $file->getRealPath();

            $configs[$name] = $values;
        }

        return $configs;
    }
824663
public function getConfig() {
		$result = [];
		$pluginName = $this->_getPluginName();
		if (empty($pluginName) || !Configure::check($pluginName)) {
			return $result;
		}

		$result = (array)Configure::read($pluginName);

		return $result;
	}
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;
    }
164030
protected function _translationFields()
    {
        $fields = $this->getConfig('fields');

        if ($fields) {
            return $fields;
        }

        $table = $this->_translationTable();
        $fields = $table->getSchema()->columns();
        $fields = array_values(array_diff($fields, ['id', 'locale']));

        $this->setConfig('fields', $fields);

        return $fields;
    }
775360
public function getAsArray(): array
    {
        $result = array();

        foreach ($this->_definition as $key => $def) {
            $result[$key] = $this->getFieldAsArray($key);
        }

        return $result;
    }
692185
public function getFormFields(): array
    {
        $properties = $this->getProperties();

        $fields = array_diff($properties, ['id']);

        $fieldsWithTypes = [];
        foreach ($fields as $field) {
            $fieldsWithTypes[$field] = null;
        }

        return $fieldsWithTypes;
    }
482631
public function toArray()
    {
        $fieldValues = [];
        foreach ($this->fieldsets as $fieldset) {
            $fieldValues = array_merge($fieldValues, $fieldset->toArray());
        }
        return $fieldValues;
    }
461552
public function toArray()
    {
        $data = [];

        foreach ($this->config as $key => $value) {
            if ($value instanceof self) {
                $value = $value->toArray();
            }

            $data[$key] = $value;
        }

        return $data;
    }
774800
public function getSaveableFields(): array
    {
        return Hash::apply($this->config('fields'), '{*}[saveable=true]', function ($array) {
            $formatted = [];
            foreach ($array as $data) {
                $formatted[$data['name']] = $data;
            }

            return $formatted;
        });
    }
1371627
public function getConfig(): array
    {
        $fullDateTimeFormat = $this->dateTimeFormatSerializer->deserialize(
            $this->userSettingService->getUserSetting('full_datetime_format')->value
        );

        $shortDateTimeFormat = $this->dateTimeFormatSerializer->deserialize(
            $this->userSettingService->getUserSetting('short_datetime_format')->value
        );

        return [
            'fullDateTime' => (string)$fullDateTimeFormat,
            'fullDate' => $fullDateTimeFormat->getDateFormat(),
            'fullTime' => $fullDateTimeFormat->getTimeFormat(),
            'shortDateTime' => (string)$shortDateTimeFormat,
            'shortDate' => $shortDateTimeFormat->getDateFormat(),
            'shortTime' => $shortDateTimeFormat->getTimeFormat(),
            /** @deprecated  */
            'full' => (string)$fullDateTimeFormat,
            /** @deprecated  */
            'short' => (string)$shortDateTimeFormat,
        ];
    }
408943
public function fields(): array
    {
        $categoryContent = 'category.term.content.'.app()->getLocale();

        return [
            Input::make($categoryContent.'.name')
                ->type('text')
                ->max(255)
                ->required()
                ->title(__('Category name'))
                ->placeholder(__('Category name'))
                ->help(__('Category title')),

            Input::make('category.term.slug')
                ->type('text')
                ->max(255)
                ->required()
                ->title(__('Slug')),

            Select::make('category.parent_id')
                ->options(function () {
                    $options = $this->query->getContent('catselect');

                    return array_replace([0=> __('Without parent')], $options);
                })
                ->title(__('Parent Category')),

            TinyMCE::make($categoryContent.'.body')
                ->title(__('Description')),

        ];
    }
169451
public function toArray()
    {
        $fieldValues = [];
        foreach ($this->fields as $group) {
            foreach ($group as $name => $field) {
                $fieldValues[$name] = $field->getValue();
            }
        }
        return $fieldValues;
    }