Correspond to merge_fields in MailChimp request
@return array ['TAGKEY' => value, ...]
193031
public function getMergeFields()
    {
        // since fev2017, MailChimp API doesn't handle null value en throw 400
        // errors when you try to add subscriber with a mergefields value to null
        foreach ($this->mergeFields as $key => $value) {
            if ($value === null) {
                unset($this->mergeFields[$key]);
            }
        }
        return $this->mergeFields;
    }
126623
public function getCMSFields() {
        $fields=new FieldList(
                            new TabSet('Root',
                                new Tab('Main', _t('Snippet.MAIN', '_Main'),
                                    DropdownField::create('LanguageID', _t('Snippet.LANGUAGE', '_Language'), SnippetLanguage::get()->where('"SnippetLanguage"."Hidden"=0 OR "SnippetLanguage"."ID"='.($this->LanguageID ? $this->LanguageID:0))->map('ID', 'Title'))->setEmptyString('---'),
                                    new TextField('Title', _t('Snippet.TITLE', '_Title'), null, 300),
                                    TextareaField::create('Description', _t('Snippet.DESCRIPTION', '_Description'))->setRows(5),
                                    PackageSelectionField::create('PackageID', _t('Snippet.PACKAGE', '_Package'), SnippetPackage::get()->map('ID', 'Title'))->setEmptyString(_t('Snippet.NOT_IN_PACKAGE', '_Not Part of a Package')),
                                    TextareaField::create('Text', _t('Snippet.CODE', '_Code'), $this->getSnippetText())->setRows(30)->addExtraClass('codeBankFullWidth')->addExtraClass('stacked'),
                                    TextareaField::create('Tags', _t('Snippet.TAGS', '_Tags (comma separate)'))->setRows(2)
                                )
                            )
                        );
        
        
        return $fields;
    }
429210
protected function getResetPasswordMailFields()
    {
    	if ($this->user->getUserId()) {
    		$result = $this->user->getResetPasswordMailFields();
    	} else {
    		$result['reset_key'] = '';
        	$result['reset_url'] = '';

    	}
    	return $result;
    }
1242599
public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->removeByName('OpeningHoursSpecification');
        $fields->addFieldsToTab(
            'Root.Main',
            array(
                TextField::create(
                    'Address',
                    _t('SchemaPlace.PAYMENTACCEPTED', 'Address')
                ),
                TextField::create(
                    'BranchCode',
                    _t('SchemaPlace.PRICERANGE', 'Branch code')
                ),
                GridField::create(
                    'OpeningHoursSpecification',
                    _t('SchemaPlace.OPENINGHOURSSPECIFICATION', 'Opening hours specification'),
                    $this->OpeningHoursSpecification(),
                    GridFieldConfig_RelationEditor::create()
                )
            )
        );
        return $fields;
    }
506878
public function getMultioptions()
    {
        $array = [];
        foreach ((new \Cms\Orm\CmsTagQuery)->orderAscId()->findPairs('tag', 'tag') as $k => $t) {
            $array[$k] = $k;
        }

        return array_merge($this->getValue(), $array);
    }
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;
    }
1196091
public function split(): array
    {
        $result = [];
        foreach ($this->recipients as $recipient) {
            $result[] = self::create(
                $this->ciphertext,
                $this->iv,
                $this->tag,
                $this->aad,
                $this->sharedHeader,
                $this->sharedProtectedHeader,
                $this->encodedSharedProtectedHeader,
                [$recipient]
            );
        }

        return $result;
    }
265834
public function getTags(): array
    {
        $typeTag = $this->implode([
            'graphql',
            strtolower($this->fieldValue->getParentName()),
            $this->fieldKey,
        ]);

        $fieldTag = $this->implode([
            'graphql',
            strtolower($this->fieldValue->getParentName()),
            $this->fieldKey,
            $this->resolveInfo->fieldName,
        ]);

        return [$typeTag, $fieldTag];
    }
749998
public function getMappedFields()
    {
        $mapped = array();

        foreach ($this->fields as $key => $value) {
            if (array_key_exists($key, $this->mappings)) {
                $map = $this->mappings[$key];
                $mapped[$map] = $value;
            }
        }

        return $mapped;
    }
101771
protected function getAccountFields()
    {
        return array(
            Tag::ContractCode => array(
                'type' => 'text',
                'label' => $this->t('field_code'),
                'attributes' => array(
                    'required' => true,
                    'size' => 20,
                ),
            ),
            Tag::UserName => array(
                'type' => 'text',
                'label' => $this->t('field_username'),
                'attributes' => array(
                    'required' => true,
                    'size' => 20,
                ),
            ),
            Tag::Password => array(
                'type' => 'password',
                'label' => $this->t('field_password'),
                'attributes' => array(
                    'required' => true,
                    'size' => 20,
                ),
            ),
            Tag::EmailOnError => array(
                'type' => 'email',
                'label' => $this->t('field_emailonerror'),
                'description' => $this->t('desc_emailonerror'),
                'attributes' => array(
                    'required' => true,
                    'size' => 20,
                ),
            ),
        );
    }
361029
private function getAddressFields($_params = array())
    {
        $params = array_merge(
            array(
                'includeHeader' => true,
            ),
            (array) $_params
        );

        $fields = array(
            TextField::create('Address', _t('Addressable.ADDRESS', 'Address')),
            TextField::create('Suburb', _t('Addressable.SUBURB', 'Suburb'))
        );

        if ($params['includeHeader']) {
            array_unshift(
                $fields,
                HeaderField::create('AddressHeader', _t('Addressable.ADDRESSHEADER', 'Address'))
            );
        }


        // Get state field
        $label = _t('Addressable.STATE', 'State');
        $allowedStates = $this->owner->getAllowedStates();
        if (count($allowedStates) >= 1) {
            // If allowed states are restricted, only allow those
            $fields[] = DropdownField::create('State', $label, $allowedStates);
        } elseif (!$allowedStates) {
            // If no allowed states defined, allow the user to type anything
            $fields[] = TextField::create('State', $label);
        }

        // Get postcode field
        $postcode = RegexTextField::create('Postcode', _t('Addressable.POSTCODE', 'Postcode'));
        $postcode->setRegex($this->getPostcodeRegex());
        $fields[] = $postcode;

        // Get country field
        $fields[] = DropdownField::create(
            'Country',
            _t('Addressable.COUNTRY', 'Country'),
            $this->owner->getAllowedCountries()
        );

        $this->owner->extend("updateAddressFields", $fields);

        return $fields;
    }
1198355
private static function _get_fields() {
		if ( ! class_exists( 'Kucrut_Form_Field' ) ) {
			require_once Menu_Icons::get( 'dir' ) . 'includes/library/form-fields.php';
		}

		$keys     = array( 'menu-icons', 'settings' );
		$sections = self::get_fields();

		foreach ( $sections as &$section ) {
			$_keys = array_merge( $keys, array( $section['id'] ) );
			$_args = array_merge( array( 'keys' => $_keys ), $section['args'] );

			foreach ( $section['fields'] as &$field ) {
				$field = Kucrut_Form_Field::create( $field, $_args );
			}

			unset( $field );
		}

		unset( $section );

		return $sections;
	}
401375
public function setMergeFields(array $mergeFields)
    {
        // since fev2017, MailChimp API doesn't handle null value en throw 400
        // errors when you try to add subscriber with a mergefields value to null
        foreach ($mergeFields as $key => $value) {
            if ($value === null) {
                unset($mergeFields[$key]);
            }
        }
        $this->mergeFields = $mergeFields;

        return $this->mergeFields;
    }
835139
private function getFieldValues()
    {
        $requestFields = [];
        if (!empty($this->payload->body) && !is_string($this->payload->body)) {
            $this->tokenHelper->newSession(
                $this->contactClient,
                $this->contact,
                $this->payload,
                $this->campaign,
                $this->event
            );
            $requestFields = $this->fieldValues($this->payload->body);
            if ($this->file) {
                $nullCsv = $this->file->getCsvNull();
                if (!empty($nullCsv)) {
                    foreach ($requestFields as $field => &$value) {
                        if (empty($value) && false !== $value) {
                            $value = $nullCsv;
                        }
                    }
                }
                // Filter out exclusion characters.
                $exclusions = $this->file->getExclusions();
                if (!empty($exclusions)) {
                    $exclusionArray = array_unique(str_split($exclusions));
                    foreach ($requestFields as $field => &$value) {
                        $value = str_replace($exclusionArray, ' ', $value);
                    }
                }
            }
        }

        return $requestFields;
    }
828572
public function synchronizeMergeFields($listId, array $mergeFields = [])
    {
        $mailChimpMergeFields = $this->listRepository->getMergeFields($listId);

        foreach ($mailChimpMergeFields as $tag) {
            if (!$this->tagExists($tag['tag'], $mergeFields)) {
                // tag only exist in mailchimp, we are removing it
                $this->listRepository->deleteMergeField($listId, $tag['merge_id']);
            }
        }

        foreach ($mergeFields as $tag) {
            if ($tagId = $this->tagExists($tag['tag'], $mailChimpMergeFields)) {
                // update mergeField in mailChimp
                $this->listRepository->updateMergeField($listId, $tagId, $tag);
            } else {
                $this->listRepository->addMergeField($listId, $tag);
            }
        }
    }
321837
protected function getFieldsExistingMessages()
    {
        $fieldsMessages = [];
        $formObject = $this->getFormObject();

        if ($formObject->formWasSubmitted()
            && $formObject->hasFormResult()
        ) {
            foreach ($this->getFormObject()->getConfiguration()->getFields() as $field) {
                $fieldsMessages[$field->getName()] = $this->getSingleFieldExistingMessages($field);
            }
        }

        return $fieldsMessages;
    }
870765
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('PresetID');
        $fields->addFieldToTab(
            'Root.Main',
            ReadonlyField::create(
                'PresetName',
                _t('PlaceableObject.PRESET', 'Preset')
            )->setValue($this->Preset()->Title)
        );
        $this->extend('updateCMSFields', $fields);
        return $fields;
    }