{{{ protected function getReplicatorFieldName()
191621
protected function getReplicatorFieldName()
    {
        $name = $this->id . '_replicators';

        $widget = $this->getFirstAncestor('SwatWidget');
        if ($widget->id) {
            $name = $widget->id . '_' . $name;
        }

        return $name;
    }
509674
public function getCMSFields()
    {
        $fields = $this->scaffoldFormFields(
            array(
                // Don't allow has_many/many_many relationship editing before the record is first saved
                'includeRelations' => ($this->ID > 0),
                'tabbed' => true,
                'ajaxSafe' => true
            )
        );
        $fields->removeByName(
            array(
                'Title',
                'Instance',
                'Style',
                'Objects'
            )
        );
        if (!$this->IsMain) {
            $fields->addFieldsToTab(
                'Root.Main',
                array(
                    TextField::create(
                        'Title',
                        _t('PlaceableObject_Preset.TITLE', 'Title')
                    ),
                    DropdownField::create(
                        'Instance',
                        _t('PlaceableObject_Preset.INSTANCE', 'Instance'),
                        singleton('PlaceableObject_Preset')->dbObject('Instance')->enumValues()
                    )
                )
            );
        }
        if ($this->Styles) {
            $fields->addFieldToTab(
                'Root.Main',
                DropdownField::create(
                    'Style',
                    _t('PlaceableObject_Preset.STYLE', 'Style'),
                    $this->Styles
                )->setEmptyString(_t('PlaceableObject_Preset.DEFAULTSTYLE', 'Default'))
            );
        }
        $fields->addFieldsToTab(
            'Root.Objects',
            array(
                LabelField::create(
                    'ObjectsDescription',
                    _t('PlaceableObject_Preset.OBJECTSDESCRIPTION', 'List of all objects that use this use this preset.')
                ),
                GridField::create(
                    'Objects',
                    _t('PlaceableObject_Preset.OBJECTS', 'Objects'),
                    $this->Objects(),
                    GridFieldConfig_Base::create()
                )
            )
        );
        $this->extend('updateCMSFields', $fields);
        return $fields;
    }
1008259
private function getFieldValue()
  {
    $model = $this->modelController->getModel();
    $fieldName = str_replace('model/','', $this->props->name);
    return $model->$fieldName;
  }
1114984
public String getFieldName() {
        if (!visitingField) {
            throw new IllegalStateException("getFieldName called while not visiting field");
        }
        if (fieldName == null) {
            fieldName = getStringFromIndex(field.getNameIndex());
        }

        return fieldName;
    }
813416
protected function renderSetOriginalFileName()
    {
        $columnsSetters = array();
        if ($this->getParameter('use_origin_fileName')) {
            foreach ($this->getColumns() as $column) {
                $columnsSetters[$column] = $this->getColumnSetter($this->getOriginalNameColumn($column));
            }

            if (count($columnsSetters)) {
                return $this->renderTemplate("setOriginalFileName", array('columnsSetters' => $columnsSetters));
            }
        }
        return '';
    }
1082793
protected function generateName()
    {
        do {
            // Generate a new random name after this class (handles namespaces)
            $classNamePieces = explode('\\', static::class);
            $class = array_pop($classNamePieces);
            $entropy = substr(sha1(uniqid()), 0, 5);
            $name = "{$class}_{$entropy}";

            // Check if it conflicts
            $exists = EditableFormField::get()->filter('Name', $name)->count() > 0;
        } while ($exists);
        return $name;
    }
23888
protected function fieldfillers() {

		$fieldrender = $this->fieldrender();

		if ($this->hintrenderer !== null) {
			$callable = &$this->hintrenderer;
			$hintsrender = $callable($this->hints());
		}
		else { # no hint renderer
			$hintsrender = null;
		}

		if ($this->showerrors && $this->errorrenderer) {
			$callable = &$this->errorrenderer;
			$errorrrender = $callable($this->errors());
		}
		else { # no error renderer
			$errorrrender = null;
		}

		return array
			(
				':id'     => $this->get('id', null),
				':field'  => $fieldrender,
				':label'  => $this->fieldlabel(),
				':hints'  => $hintsrender,
				':errors' => $errorrrender,
			);
	}
172003
public function getInputName()
  {
    $n = false;
    if ($f = $this->getForm()) {
      $n = $f->getName();
    }

    $inp = $this->getField();

    return $n ? $n . '[' . $inp . ']' : $inp;
  }
1366546
public function getGetterName()
    {
        return $this->replaceReservedMethod(sprintf('get%s', ucfirst($this->getUniqueName('get'))), $this->getOwner()->getPackagedName());
    }
106519
public function generateAlteredFields()
    {
        /* @var $oldField Field */
        /* @var $newField Field */
        foreach ($this->keptModelKeys as $modelName) {
            $oldFieldKeys = $this->oldFieldKeys[$modelName];
            $newFieldKeys = $this->newFieldKeys[$modelName];

            $keptFieldKeys = array_intersect($oldFieldKeys, $newFieldKeys);

            $oldModelName = $this->getOldModelName($modelName);

            foreach ($keptFieldKeys as $keptField) {
                $oldFieldName = $this->getOldFieldName($modelName, $keptField);
                $oldField = $this->oldRegistry->getModel($oldModelName)
                    ->getMeta()
                    ->getField($oldFieldName);

                $meta = $this->newRegistry->getModel(
                    $modelName
                )->getMeta();
                $newField = $meta->getField($keptField);

                $oldDec = $this->deepDeconstruct($oldField);
                $newDec = $this->deepDeconstruct($newField);

                if ($oldDec !== $newDec) {
                    $bothM2M = ($newField instanceof ManyToManyField &&
                        $oldField instanceof ManyToManyField);
                    $neitherM2M = (!$newField instanceof ManyToManyField &&
                        !$oldField instanceof ManyToManyField);

                    // Either both fields are m2m or neither is
                    if ($bothM2M || $neitherM2M) {
                        $preserveDefault = true;

                        if ($oldField->isNull() && !$newField->isNull() &&
                            !$newField->hasDefault() &&
                            !$newField instanceof ManyToManyField
                        ) {
                            $field = $newField->deepClone();
                            $default = MigrationQuestion::askNotNullAlteration(
                                $this->asker,
                                $modelName,
                                $keptField
                            );

                            if (NOT_PROVIDED !== $default) {
                                $field->default = $default;
                                $preserveDefault = false;
                            }
                        } else {
                            $field = $newField;
                        }

                        $this->addOperation(
                            $meta->getAppName(),
                            AlterField::createObject(
                                [
                                    'modelName' => $modelName,
                                    'name' => $keptField,
                                    'field' => $field,
                                    'preserveDefault' => $preserveDefault,
                                ]
                            )
                        );
                    } else {
                        // We cannot alter between m2m and concrete fields
                        $this->findRemovedFields($modelName, $keptField);
                        $this->findAddedFields($modelName, $keptField);
                    }
                }
            }
        }
    }
772120
public function getFieldNames()
    {
        $names = [];

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

        return $names;
    }
157269
protected function getDefaultFieldNamePrefix()
    {
        $request = $this->controllerContext->getRequest();
        if (!$request->isMainRequest()) {
            if ($this->arguments['useParentRequest'] === true) {
                return $request->getParentRequest()->getArgumentNamespace();
            } else {
                return $request->getArgumentNamespace();
            }
        }
        return '';
    }
1176465
protected function getFieldName(): string
    {
        if ($this->language === null) {
            return $this->name;
        }

        return $this->name . '_' . strtolower($this->language->getShortName());
    }
417045
private function getInsertFieldsString()
    {
        // Get field keys
        $fieldKeys = array_keys($this->fields);

        // Create placeholders
        $fieldsPlaceholders = array_map(function ($field) {
            return ':' . $field;
        }, $fieldKeys);

        // Return complete fields string
        return '(' . implode(',', $fieldKeys) . ') VALUES ('. implode(',', $fieldsPlaceholders) . ')';
    }
624718
private function getStdSeparatedName()
	{
		if ($this->schema && $this->getBuildProperty('schemaAutoPrefix')) {
			return $this->schema . NameGenerator::STD_SEPARATOR_CHAR . $this->getCommonName();
		} else {
			return $this->getCommonName();
		}
	}
950225
protected function generateFields()
	{
		$hiddenFields = '';

		$fields = array_reduce( $this->fields, function( $carry, $formField ) use ( &$hiddenFields ) {

			$stringLegend    = '<legend class="screen-reader-text"><span>%s</span></legend>';
			$stringFieldset  = '<fieldset%s>%s%s</fieldset>';
			$stringRendered  = '<tr class="glsr-field %s"><th scope="row">%s</th><td>%s</td></tr>';
			$outsideRendered = '</tbody></table>%s<table class="form-table"><tbody>';

			// set field value only when rendering because we need to check the default setting
			// against the database
			$field = $formField->setValue()->getField();

			$multi    = $field->multi === true;
			$label    = $field->generateLabel();
			$rendered = $field->render();

			// render hidden inputs outside the table
			if( $field->args['type'] === 'hidden' ) {
				$hiddenFields .= $rendered;
				return $carry;
			}

			$hiddenClass = $this->isFieldHidden( $formField ) ? 'hidden' : '';

			if( $multi ) {
				if( $depends = $formField->getDataDepends() ) {
					$depends = sprintf( ' data-depends=\'%s\'', json_encode( $depends ));
				}

				$legend = $label ? sprintf( $stringLegend, $label ) : '';
				$rendered = sprintf( $stringFieldset, $depends, $legend, $rendered );
			}

			$renderedField = $field->outside
				? sprintf( $outsideRendered, $rendered )
				: sprintf( $stringRendered, $hiddenClass, $label, $rendered );

			return $carry . $renderedField;
		});

		return sprintf( '<table class="form-table"><tbody>%s</tbody></table>%s', $fields, $hiddenFields );
	}
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;
    }