@param array $fieldOptions

@return array
433976
public function reverseTransform($fieldOptions)
    {
        $result = array();
        $fieldOptionClass = $this->fieldOptionClass;

        foreach ($fieldOptions as $key => $value) {
            $fieldOption = new $fieldOptionClass();
            $fieldOption->setKey($key);
            $fieldOption->setValue($value);
            $result[] = $fieldOption;
        }

        return $result;
    }
19679
protected function getOptions(FieldTypeInterface $field)
    {
        $options = parent::getOptions($field);

        $options['items'] = array_map(function ($id) {
            return [
                'attributes' => wp_prepare_attachment_for_js($id),
                'id' => $id
            ];
        }, (array) $field->getValue());

        return $options;
    }
650917
protected function getFieldValues($fields)
    {
        $result = array();
        foreach ($fields as $id => $field) {
            if (isset($field['value'])) {
                $result[$id] = $field['value'];
            }
            if (!empty($field['fields'])) {
                /** @noinspection SlowArrayOperationsInLoopInspection */
                $result = array_merge($result, $this->getFieldValues($field['fields']));
            }
        }
        return $result;
    }
145104
public function getFormFieldValueOptions(FieldInterface $field)
    {
        $fieldOptions = $this->getFieldOptions($field);

        $formFieldOptions = [];
        if (isset($fieldOptions['minLength'])) {
            $formFieldOptions['constraints'][] = new Length(['min' => $fieldOptions['minLength']]);
        }
        if (isset($fieldOptions['maxLength'])) {
            $formFieldOptions['constraints'][] = new Length(['max' => $fieldOptions['maxLength']]);
        }

        return $formFieldOptions;
    }
141747
public function tryGetOptionsForValues(array $values): array
    {
        if ($this->specificFieldOptionLoader) {
            return array_filter(array_map($this->specificFieldOptionLoader, $values));
        } else {
            return (new ArrayFieldOptions(call_user_func($this->fieldOptionsLoader)))->tryGetOptionsForValues($value);
        }
    }
376230
protected function setFieldList(array $options) {
        $fields = $this->getDriverEscaper()->getAllFields();
        if (array_key_exists('fields', $options)) {
            $fieldsList = [];
            foreach ($options['fields'] as $field) {
                $fieldsList[] = $this->getDriverEscaper()->reserved($field);
            }
            $fields = implode(' ' . $this->getDriverEscaper()->getFieldsSeparator() . ' ', $fieldsList);
        }
        return $fields;
    }
713896
private function configure(array $options): array
    {
        $resolver = new OptionsResolver();
        $resolver->setDefined('message');

        $this->configureOptions($resolver);

        return $resolver->resolve($options);
    }
491346
public function getOptions(array $defaultOptions = []): array
    {
        $options = $this->options;
        $options['TTL'] = array_key_exists('TTL', $options) ? $options['TTL'] : $defaultOptions['TTL'];
        $options['urgency'] = array_key_exists('urgency', $options) ? $options['urgency'] : $defaultOptions['urgency'];
        $options['topic'] = array_key_exists('topic', $options) ? $options['topic'] : $defaultOptions['topic'];

        return $options;
    }
992905
protected function prepareFields($options = [])
    {
        $params = $this->toArray($options);

        if (empty($this->mapper)) {
            return $params;
        }

        foreach ($this->mapper as $modelKey => $apiKey) {
            if(array_key_exists($modelKey,$params)) {
                $params[$apiKey] = $params[$modelKey];
                unset($params[$modelKey]);
            }
        }

        return $params;
    }
477103
public function getDefaultFormFieldValueOptions(FieldInterface $field)
    {
        $defaultOptions = ['label' => false];
        if ($field->getHint()) {
            $defaultOptions['attr']['help'] = $field->getHint();
        }
        return $defaultOptions;
    }
612143
protected function getOptions(array  $options): array
    {
        $options['format'] = array_get($options, 'format', $this->format);
        $options['locale'] = array_get($options, 'locale', config('app.locale'));

        return $options;
    }
1369011
protected function parseOptions(array $options): array
    {
        // Set a default "id" attribute. This attribute can be used on the field
        // and to its associated label as the "for" attribute value if not set.
        if (! isset($options['attributes']['id'])) {
            $options['attributes']['id'] = $this->getName().'_field';
        }

        // Set the "for" attribute automatically on the label attributes property.
        if (! isset($options['label_attr']['for'])) {
            $options['label_attr']['for'] = $options['attributes']['id'];
        }

        // Set some default CSS classes if chosen theme is "bootstrap".
        if (isset($options['theme']) && 'bootstrap' === $options['theme']) {
            if (isset($options['attributes']['class'])) {
                $options['attributes']['class'] .= ' form-control';
            } else {
                $options['attributes']['class'] = 'form-control';
            }
        }

        // Set default value if defined.
        if (isset($options['data']) && ! is_null($options['data'])) {
            $this->setValue($options['data']);
        }

        return $options;
    }
1062934
public static function prepareOptions(array $options) : array
    {
        if (empty($options['fields'])) {
            return [];
        }

        $result = [];
        foreach ($options['fields'] as $field => $params) {
            if (empty($params['column']) && empty($params['default'])) {
                continue;
            }

            $result['fields'][$field] = $params;
        }

        return $result;
    }
52219
protected function _normalizeFormFields($fields)
    {
        $_options = [
            'on' => 'both'
        ];

        $_defaults = [
            '_create' => $_options
        ];

        $result = [];

        $result['_create'] = $_defaults['_create'];

        foreach ($fields as $name => $options) {
            if (is_array($options)) {
                $result[$name] = array_merge($_options, $options);
            } else {
                $result[$options] = $_options;
            }
        }
        return $result;
    }
556301
private function getFieldLayoutFieldsDefinition(array $fields): array
    {
        $fieldDefinitions = [];

        foreach ($fields as $field) {
            $fieldDefinitions[$field->handle] = $field->required;
        }

        return $fieldDefinitions;
    }
882044
public function setOptional($fields)
    {

        if (empty($fields) === false) {

            if (is_array($fields) === true) {
                $this->optionalFields = implode(',', $fields);
            } else {
                $this->optionalFields = $fields;

            }
        }

        return $this;

    }
1358162
private function addFieldChoiceOptions(array &$options, array $formFieldConfiguration, array $fieldConfiguration)
    {
        if (isset($formFieldConfiguration['options'])) {
            $fieldConfiguration['options'] = $formFieldConfiguration['options'];
        }

        if (isset($fieldConfiguration['options'])) {
            $options['choices'] = array();
            foreach ($fieldConfiguration['options'] as $option) {
                $options['choices'][$option['label']] = $option['value'];
            }
        }
    }