Gets extensions with customfields

@return array
491267
protected function getCustomfields()
    {
        $extensions = extensions();
        $return     = [];
        event('customfields.before.search', $return);
        event(new BeforeSearch($return));

        foreach ($extensions as $name => $extension) {
            $name   = 'antares/' . str_replace(['component-', 'module-'], '', $extension['name']);
            $config = config($name . '::customfields');
            if (empty($config)) {
                continue;
            }
            if (!$this->validate($config)) {
                continue;
            }

            array_walk($config, function(&$value, $key) {
                if (is_array($value)) {

                    foreach ($value as $index => &$customfield) {
                        if (!class_exists($customfield)) {
                            unset($value[$index]);
                            continue;
                        }
                        $customfield = app($customfield);
                    }
                } else {
                    $value = app($value);
                }
            });

            foreach ($config as $name => $customfields) {
                if (isset($return[$name])) {
                    $return[$name] = array_merge($return[$name], $customfields);
                } else {
                    $return[$name] = $customfields;
                }
            }
        }

        event('customfields.after.search', [$return]);
        event(new AfterSearch($return));
        return $return;
    }
26705
public static function get_available_field_types() {
        $fieldtypes = array();

        $plugins = \core\plugininfo\customfield::get_enabled_plugins();
        foreach ($plugins as $type => $unused) {
            $fieldtypes[$type] = get_string('pluginname', 'customfield_' . $type);
        }
        asort($fieldtypes);

        return $fieldtypes;
    }
781104
protected function getAdvancedConfigLinkFields()
    {
        return array(
            'tellAboutAdvancedSettings' => array(
                'type' => 'markup',
                'value' => sprintf($this->t('desc_advancedSettings'), $this->t('advanced_form_link_text'), $this->t('menu_advancedSettings')),
            ),
            'advancedSettingsLink' => array(
                'type' => 'markup',
                'value' => sprintf($this->t('button_link'), $this->t('advanced_form_link_text'), $this->shopCapabilities->getLink('advanced')),
            ),
        );
    }
1095043
public function getEditFieldsArrays($override = false)
    {
        $return = array();

        foreach ($this->getEditFields(true, $override) as $fieldObject) {
            $return[$fieldObject->getOption('field_name')] = $fieldObject->getOptions();
        }

        //get the key field if this is a model page
        if ($this->config->getType() === 'model') {
            $this->fillKeyField($return);
        }

        return $return;
    }
991034
protected function getFields()
    {
        return [
          'title' => new Field('Project title', [
            'optionName' => 'title',
            'description' => 'The initial project title',
            'questionLine' => '',
            'default' => 'Untitled Project',
          ]),
          'region' => new OptionsField('Region', [
            'optionName' => 'region',
            'description' => 'The region where the project will be hosted',
            'options' => $this->getAvailableRegions(),
            'optionsCallback' => function () {
                return $this->getAvailableRegions(true);
            },
          ]),
          'plan' => new OptionsField('Plan', [
            'optionName' => 'plan',
            'description' => 'The subscription plan',
            'options' => $this->getAvailablePlans(),
            'default' => in_array('development', $this->getAvailablePlans()) ? 'development' : null,
            'allowOther' => true,
          ]),
          'environments' => new Field('Environments', [
            'optionName' => 'environments',
            'description' => 'The number of environments',
            'default' => 3,
            'validator' => function ($value) {
                return is_numeric($value) && $value > 0 && $value < 50;
            },
          ]),
          'storage' => new Field('Storage', [
            'description' => 'The amount of storage per environment, in GiB',
            'default' => 5,
            'validator' => function ($value) {
                return is_numeric($value) && $value > 0 && $value < 1024;
            },
          ]),
        ];
    }
951055
private function getAdditionalTableFields()
    {
        $type  = $this->eavConfig->getEntityType(\Magento\Catalog\Model\Product::ENTITY);
        $table = $type->getAdditionalAttributeTable();
        $fullTableName = $this->getResource()->getTable($table);
        $tableDesc = $this->getConnection()->describeTable($fullTableName);
        $tableFields = array_keys($tableDesc);

        return array_diff($tableFields, $this->overridenColumns);
    }
45718
public function GetProductNameExtensions()
    {
        $sName = trim($this->fieldNameProduct);
        if (empty($sName)) {
            $sName = $this->fieldName;
        }

        return $sName;
    }
285329
public function getFields()
    {
        if (null == $this->fields) {
            $properties = $this->inspector->getClassProperties();
            $this->fields = new FieldsCollection();
            foreach ($properties as $property) {
                $this->addDescriptor($property);
            }
        }
        return $this->fields;
    }
322285
public function getCMSFields() {

        $fields = parent::getCMSFields();

        $fields->addFieldsToTab('Root.Gallery', [

            UploadField::create(
                'GalleryImages',
                'Gallery Images'
            )
            ->setFolderName('gallery-images')
            ->setAllowedExtensions(['jpg', 'jpeg', 'png', 'gif', 'bmp'])

        ]);

        return $fields;
    }
657415
public function getExtensionConfig()
    {
        if (!is_array($this->extensionConfig)) {
            $composerjson = $this->getComposerJSON();
            if (is_array($composerjson)) {
                $this->extensionConfig = [
                    strtolower($composerjson['name']) => [
                        'name' => $this->getName(),
                        'json' => $composerjson,
                    ],
                ];
            } else {
                $this->extensionConfig = [
                    $this->getName() => [
                        'name' => $this->getName(),
                        'json' => [],
                    ],
                ];
            }
        }

        return $this->extensionConfig;
    }
1164776
public function getFields() {
        if($this->cachedFields == null) {
            $this->cachedFields = $this->createFields();
        }

        return $this->cachedFields;
    }
111152
public function customFieldsToArray()
    {
        $result = [];
        foreach ($this->getCustomFields() as $field) {
            $result[$field->getInternalFieldName()] = $field->getValue();
        }

        return $result;
    }
867019
public static function getExtraFields(){
        return array_map(function($field){
            $extra = [
                'id' => $field['id'],
                'label' => $field['label'],
                'filterable' => array_key_exists('filterable', $field) ? $field['filterable'] : false,
            ];
            if (array_key_exists('columnPosition', $field)) {
                $extra['columnPosition'] = $field['columnPosition'];
            }
            return $extra;
        }, self::_getUserExtraFields());
    }
1249287
protected function getExtensions()
    {
        if (null === $this->extensions) {
            $basename = $this->getBasename();

            # Avoid treating name of a dotfile as extension by
            # ignoring dots at the first offset in the string
            if (!$basename or false === ($pos = strpos($basename, '.', 1))) {
                return array();
            }

            $extensions = explode('.', substr($basename, $pos + 1));

            $this->extensions = array_map(function($ext) {
                return Path::normalizeExtension($ext);
            }, $extensions);
        }

        return $this->extensions;
    }
240393
public function getExtensionsByType()
  {
    $ext = array();

    foreach ($this->Config->get('file-extensions') as $key => $value)
    {
      $ext[$key] = $value['extensions'];
    }

    return $ext;
  }
1130458
public function getEnabledExtensions()
    {
        $returnValue = array();

        $enabled = $this->getExtensionById('generis')->getConfig(self::EXTENSIONS_CONFIG_KEY);
        foreach ($this->getInstalledExtensions() as $ext) {
            if (isset($enabled[$ext->getId()]) && $enabled[$ext->getId()]['enabled']) {
                $returnValue[$ext->getId()] = $ext;
            }
        }
    
        return (array) $returnValue;
    }
969982
private function customFieldInstance($prefix): array
    {
        $ns = $this->xmlns[$prefix];

        if (!$discoveredCustomField = $this->customFields[$ns]) {
            throw new LogicException(
                sprintf(
                    'No custom field class was found for %s. setCustomFields() must be called before using this extractor.',
                    $ns
                )
            );
        }

        return [new Type('object', false, $discoveredCustomField->getClass())];
    }