Get saveable fields

@return array
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;
        });
    }
1111615
private function changedRevisionableFields()
    {
        $changes_to_record = array();
        foreach ($this->dirtyData as $key => $value) {
            // check that the field is revisionable, and double check
            // that it's actually new data in case dirty is, well, clean
            if ($this->isRevisionable($key) && !is_array($value)) {
                if (!isset($this->originalData[$key]) || $this->originalData[$key] != $this->updatedData[$key]) {
                    $changes_to_record[$key] = $value;
                }
            } else {
                // we don't need these any more, and they could
                // contain a lot of data, so lets trash them.
                unset($this->updatedData[$key]);
                unset($this->originalData[$key]);
            }
        }

        return $changes_to_record;
    }
306197
protected function fields()
    {
        if (isset($this->fillables)) {
            $this->output = (sizeof($this->fillables) > 0) ? implode($this->fillables, ',') : '*';
        } else {
            $this->output = '*';
        }

        return $this->output;
    }
240974
private function getSortFieldValues()
    {
        return [
            Location::SORT_FIELD_NAME,
            Location::SORT_FIELD_CLASS_NAME,
            Location::SORT_FIELD_CLASS_IDENTIFIER,
            Location::SORT_FIELD_DEPTH,
            Location::SORT_FIELD_PATH,
            Location::SORT_FIELD_PRIORITY,
            Location::SORT_FIELD_MODIFIED,
            Location::SORT_FIELD_PUBLISHED,
            Location::SORT_FIELD_SECTION,
        ];
    }
8869
protected function getFields() {
        if (!$this->_fields) {
            $this->_fields = new FieldList(
                $this->version,
                $this->solution['assistantSid'],
                $this->solution['sid']
            );
        }

        return $this->_fields;
    }
159158
public function getMappableColumns()
    {
        if (!empty($this->mappableFields)) {
            return $this->mappableFields;
        }
        $scaffolded = $this->scaffoldMappableFields();
        if (!empty($this->transforms)) {
            $transformables = array_keys($this->transforms);
            $transformables = array_combine($transformables, $transformables);
            $scaffolded = array_merge($transformables, $scaffolded);
        }
        natcasesort($scaffolded);

        return $scaffolded;
    }
1192184
public function getAvailable(): array
    {
        $result = [];

        $dbLanguages = $this->find('list', ['keyField' => 'code', 'valueField' => 'name'])
                            ->where(['trashed IS' => null])
                            ->toArray();
        $supportedLanguages = $this->getSupported();
        $result = array_diff_assoc($supportedLanguages, $dbLanguages);

        return $result;
    }
121918
public function getCMSFields()
    {
        /** @var FieldList $fields */
        $fields = parent::getCMSFields();

        // Get protector
        $protector = FormSpamProtectionExtension::get_protector();
        if (!$protector) {
            return $fields;
        }

        if ($this->Parent()->Fields() instanceof UnsavedRelationList) {
            return $fields;
        }

        // Each other text field in this group can be assigned a field mapping
        $mapGroup = FieldGroup::create()
            ->setTitle(_t(__CLASS__.'.SPAMFIELDMAPPING', 'Spam Field Mapping'))
            ->setName('SpamFieldMapping')
            ->setDescription(_t(
                __CLASS__.'.SPAMFIELDMAPPINGDESCRIPTION',
                'Select the form fields that correspond to any relevant spam protection identifiers'
            ));

        // Generate field specific settings
        $mappableFields = FormSpamProtectionExtension::config()->get('mappable_fields');
        $mappableFieldsMerged = array_combine($mappableFields, $mappableFields);
        foreach ($this->getCandidateFields() as $otherField) {
            $mapSetting = "Map-{$otherField->Name}";
            $fieldOption = DropdownField::create(
                'spammap-' . $mapSetting,
                $otherField->Title,
                $mappableFieldsMerged,
                $this->spamMapValue($mapSetting)
            )->setEmptyString('');
            $mapGroup->push($fieldOption);
        }
        $fields->addFieldToTab('Root.Main', $mapGroup);

        return $fields;
    }
173212
public function getActionAllowableValues()
    {
        return [
            self::ACTION_ADD,
            self::ACTION_ASSEMBLE,
            self::ACTION_CONFIGURE,
            self::ACTION_ENTER_PASSWORD,
            self::ACTION_LOCK,
            self::ACTION_MOVE,
            self::ACTION_REPACKAGE,
            self::ACTION_SET_NAME,
            self::ACTION_SET_PASSWORD,
            self::ACTION_UNLOCK,
        ];
    }
1030528
public function getFlattenedFields()
    {
        if (!isset($this->flatFields)) {
            $this->flatFields = [];

            foreach ($this->fields as $field) {
                if (isset($field['fields']) && is_array($field['fields'])) {
                    $this->flatFields += $this->flattenCollection($field);
                } else {
                    $this->flatFields[$field['name']] = $field;
                }
            }
        }

        return $this->flatFields;
    }
1273784
private function getEditableProperties()
    {
        if (!isset($this->_editableProperties)) {
            $reflection = new ReflectionClass('WhEditableField');
            $this->_editableProperties = array_map(
                function ($d) {
                    return $d->getName();
                },
                $reflection->getProperties()
            );
        }
        return $this->_editableProperties;
    }
1078479
public function getStatusAllowableValues()
    {
        return [
            self::STATUS_OK,
            self::STATUS_ERROR,
            self::STATUS_CREATING,
            self::STATUS_DELETING,
            self::STATUS_UPDATING,
            self::STATUS_DISABLED,
        ];
    }
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;
    }
769359
public function enabledFields()
    {
        return array_merge(
            (is_string($this->guidAttribute) && !empty($this->guidAttribute)) ? [$this->guidAttribute] : [],
            (is_string($this->idAttribute) && !empty($this->idAttribute)) ? [$this->idAttribute] : [],
            $this->enabledTimestampFields(),
            $this->enabledIPFields()
        );
    }
1067928
public function getChangedFields() {
        if($this->isAfterSave() && method_exists($this->getEntity(), 'getUpdatedFields')) {
            if($this->getEntity()->hasSnapshotData()) {
                $actualChangedFields = $this->getEntity()->getUpdatedFields();
            } else {
                $actualChangedFields = $this->getSnapshotData();
            }
        } else { //Legacy
            $actualChangedFields = $this->getEntity()->getChangedFields();
        }
        $model = $this->getEntity();
        foreach($actualChangedFields as $index => $changedField) {
            $newValue = $model->readAttribute($changedField);
            if(is_array($newValue)) {
                $newValue = json_encode($newValue);
            }
            $oldValue = $this->getSnapshotData()[$changedField] ?? null ?? null;
            if(is_object($oldValue)) {
                $oldValue = (string)$oldValue;
            }
            if(is_object($newValue)) {
                $newValue = (string)$newValue;
            }
            if(is_bool($oldValue) || is_bool($newValue)){
                $oldValue = (bool) $oldValue;
                $newValue = (bool) $newValue;
            }
            if($oldValue === $newValue) {
                unset($actualChangedFields[$index]);
            }

        }
        return array_values($actualChangedFields);
    }
1343933
public function getFields()
    {
        $fields = $this->getInput('fields');

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

        return array_map(function ($fields) {
            return explode(',', $fields);
        }, $fields);
    }
551799
public function getWritableValues(): array
    {
        $result = array();

        foreach ($this->_definition as $key => $value) {
            if ($this->isWritable($key)) {
                $result[$key] = $this->$key;
            }
        }

        return $result;
    }