Custom output fields.

@return array
355621
public function getCustomFieldsAttribute()
    {
        if (class_exists($class = $this->owner_type)) {
            $customFields = [];
            foreach ($this->getCustomFields($class) as $field => $message) {
                if (is_array($message) && isset($message[$this->type])) {
                    $customFields[$field] = $this->resolveCustomMessage($message[$this->type]);
                } elseif (is_string($message)) {
                    $customFields[$field] = $this->resolveCustomMessage($message);
                }
            }

            return array_filter($customFields);
        } else {
            return false;
        }
    }
11721
public function getFields()
    {
        $fields = [];
        foreach ($this->fieldsets as $fieldset) {
            $fields = array_merge($fields, $fieldset->getAllFields());
        }
        return $fields;
    }
850691
public function getExportFields()
    {
        $export_fields = Config::inst()->get(
            $this->modelClass,
            self::EXPORT_FIELDS
        );

        if (isset($export_fields) && is_array($export_fields)) {
            $fields = $export_fields;
        } else {
            $fields = parent::getExportFields();
        }

        $this->extend("updateExportFields", $fields);

        return $fields;
    }
307175
public function toOptionArray()
    {
        $fields = $this->dataHelper->getOrderTableDescription();

        $customFields[] = [
            'label' => __('---- Default Option ----'),
            'value' => '0',
        ];
        foreach ($fields as $field) {
            $customFields[] = [
                'value' => $field['COLUMN_NAME'],
                'label' => $field['COLUMN_NAME'],
            ];
        }

        return $customFields;
    }
496491
protected function getOwnFields()
    {
        $type = $this->getType();

        if (isset($this->fields[$type])) {
            return $this->fields[$type];
        }
    }
530103
public function getExportFields()
    {
        $fields = array();
        foreach (DataObject::getSchema()->databaseFields($this->modelClass) as $field => $spec) {
            $fields[$field] = $field;
        }
        return $fields;
    }
942153
final public function export(): array
    {
        $finalArray = [];
        $mandatoryFields = $this->getMandatoryFields();

        $cleanObject = new $this();
        foreach ($cleanObject as $fieldId => $value) {
            if ($this->$fieldId === $cleanObject->$fieldId) {
                if (\in_array($fieldId, $mandatoryFields, true)) {
                    $missingMandatoryField = new MissingMandatoryField(sprintf(
                        'The field "%s" for class "%s" is mandatory and empty, please correct',
                        $fieldId,
                        \get_class($cleanObject)
                    ));
                    $missingMandatoryField->method = \get_class($cleanObject);
                    $missingMandatoryField->methodInstance = $this;
                    throw $missingMandatoryField;
                }
            } else {
                $finalArray[$fieldId] = $this->$fieldId;
            }
        }

        return $finalArray;
    }
1230724
public function Fields()
    {
        foreach ($this->getExtraFields() as $field) {
            if (!$this->fields->fieldByName($field->getName())) {
                $this->fields->push($field);
            }
        }

        return $this->fields;
    }
804665
public function list_fields()
	{
		$field_names = array();
		for ($i = 0, $c = $this->num_fields(); $i < $c; $i++)
		{
			$field_names[] = pg_field_name($this->result_id, $i);
		}

		return $field_names;
	}
267472
public function getUploadEditorFields()
    {
        /** @var FieldList $fields */
        $fields = FieldList::create();
        $translatedFields = TranslatableDataObject::get_localized_class_fields($this->owner->class);
        $transformation = null;
        $defaultLocale = Translatable::default_locale();
        if ($defaultLocale != Translatable::get_current_locale()) {
            /** @var TranslatableFormFieldTransformation $transformation */
            $transformation = TranslatableFormFieldTransformation::create($this->owner);
        }

        foreach ($translatedFields as $fieldName) {
            // create the field in the default locale
            /** @var FormField $field */
            $field = $this->owner->getLocalizedFormField($fieldName, $defaultLocale);
            // use translated title if available
            $field->setTitle(_t('File.' . $fieldName, $fieldName));

            // if not in the default locale, we apply the form field transformation to the field
            if ($transformation) {
                $field = $transformation->transformFormField($field);
            }

            $fields->push($field);
        }
        return $fields;
    }
1079009
public function renderFields()
    {
        $result = '';
        foreach ($this->fields as $field => $value) {
            $result .= '<input type="hidden" name="' . $field . '" value="' . $value . '"/>' . "\r\n";
        }

        return $result;
    }
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)];
    }
9717
public function loadOutputStyles()
    {
        $styleOne   = array('bold');
        $styleTwo   = array('bold', 'underscore');
        $style      = new OutputFormatterStyle();
        $this->output->getFormatter()->setStyle('normal', $style);
        $style      = new OutputFormatterStyle('white', 'red', $styleOne);
        $this->output->getFormatter()->setStyle('warning', $style);
        $style      = new OutputFormatterStyle('white', 'green', $styleOne);
        $this->output->getFormatter()->setStyle('general', $style);
        $style      = new OutputFormatterStyle('white', 'blue', $styleOne);
        $this->output->getFormatter()->setStyle('notice', $style);
        $style      = new OutputFormatterStyle('white', 'red', $styleTwo);
        $this->output->getFormatter()->setStyle('fatal_error', $style);
    }
619861
protected function getVariables()
    {
        foreach ($this->fields as $field) {
            $field->fill($this->data);
        }

        return [
            'fields' => $this->fields,
            'attributes' => $this->formatAttribute(),
            'method' => $this->attributes['method'],
        ];
    }
630314
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Style Fields:
        
        $fields->addFieldToTab(
            'Root.Style',
            FieldSection::create(
                'ColumnStyle',
                $this->fieldLabel('Column'),
                [
                    ViewportsField::create(
                        'ColumnSpan',
                        $this->fieldLabel('Span'),
                        $this->getColumnSpanOptions()
                    )
                ]
            )
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
851492
public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $listGridConfig = GridFieldConfig_RelationEditor::create();
        if ($this->Items()->Count() > 0) {
            $listGridConfig->addComponent(new GridFieldOrderableRows());
        }

        $fields->addFieldToTab(
            'Root.Main',
            GridField::create(
                'Items',
                'List',
                $this->Items(),
                $listGridConfig
            )
        );

        $this->extend('updateCMSFields', $fields);

        return $fields;
    }
1145866
function get_custom_fields_name () {
    $path = MF_PATH.'/field_types/*';
    $folders = glob($path,GLOB_ONLYDIR);

    $fields = array();

    foreach($folders as $folder) {
      $name = preg_match('/\/([\w\_]+)\_field$/i',$folder,$name_match);
      $fields[$name_match[1]] = preg_replace('/_/',' ',$name_match[1]);
    }

    return $fields;
  }