Get custom profile fields.

@return array
764937
private function GetProfileFields() {
      $Fields = C('ProfileExtender.Fields', array());

      if (!is_array($Fields))
         $Fields = array();

      // Data checks
      foreach ($Fields as $Name => $Field) {
         // Require an array for each field
         if (!is_array($Field) || strlen($Name) < 1) {
            unset($Fields[$Name]);
            //RemoveFromConfig('ProfileExtender.Fields.'.$Name);
         }

         // Verify field form type
         if (!isset($Field['FormType']))
            $Fields[$Name]['FormType'] = 'TextBox';
         elseif (!array_key_exists($Field['FormType'], $this->FormTypes))
            unset($this->ProfileFields[$Name]);
      }

      return $Fields;
   }
1362583
public function export()
    {
        $propertyList = [];
        foreach ($this->names as $iri) {
            $profiledName                = strval($iri);
            $cursor                      = $this->nameToCursor[$profiledName];
            $propertyList[$profiledName] = array_map(
                function (ExportableInterface $value) {
                    return $value->export();
                },
                $this->values[$cursor]
            );
        }

        return $propertyList;
    }
1318664
private function getFileFields() : array
    {
        $config = new ModuleConfig(ConfigType::MIGRATION(), $this->table->getAlias());
        $config = json_encode($config->parse());
        if (false === $config) {
            return [];
        }

        $fields = json_decode($config, true);

        if (empty($fields)) {
            return [];
        }

        $fields = array_filter($fields, function ($params) {
            return in_array($params['type'], self::FIELD_TYPES);
        });

        return array_keys($fields);
    }
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,
                ),
            ),
        );
    }
365791
public function getFields()
    {
        $model = $this->getModelInstance();
        $fields = $model->getFillable();
        $filtered_fields = [];

        foreach ($fields as $f) {
            if ($f !== 'password' && $f !== 'Password') {
                $filtered_fields[] = $f;
            }
        }

        return $filtered_fields;
    }
851492
public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $listGridConfig = GridFieldConfig_RelationEditor::create();
        if ($this->Items()->Count() > 0) {
            $listGridConfig->addComponent(new GridFieldOrderableRows());
        }

        $fields->addFieldToTab(
            'Root.Main',
            GridField::create(
                'Items',
                'List',
                $this->Items(),
                $listGridConfig
            )
        );

        $this->extend('updateCMSFields', $fields);

        return $fields;
    }
354288
public function getData()
    {
        return [
            'user___user__view_profile' => 'View user profile',
            'user___user__view_own_profile' => [
                'type' => Item::TYPE_PERMISSION,
                'description' => 'View user own profile',
                'rule' => new UpdateOwnDataRule(),
                'children' => ['user___user__view_profile']
            ],
            'user' => [
                'type' => Item::TYPE_ROLE,
                'description' => 'User',
                'children' => ['user___user__view_own_profile'],
            ],
            'admin' => [
                'type' => Item::TYPE_ROLE,
                'description' => 'Admin',
                'children' => ['user___user__view_profile']
            ],
            'owner' => [
                'type' => Item::TYPE_ROLE,
                'description' => 'Application owner',
                'children' => ['admin'],
            ]
        ];
    }
1127115
public function getDefaultDetailFieldsConfig()
    {
        if (is_array($this->owner->config()->default_detail_fields)) {
            return $this->owner->config()->default_detail_fields;
        }
        
        return [];
    }
726836
protected function getUnselectedFields() {
    $profile_fields = $this->fieldStorage->loadByProperties(['entity_type' => 'profile', 'bundle' => 'profile']);
    $settings = $this->configFactory->get('social_profile_fields.settings');
    $empty = [];

    /** @var \Drupal\field\Entity\FieldConfig $value */
    foreach ($profile_fields as $key => $value) {
      $sval = $settings->get(str_replace('.', '_', $key));

      if (isset($sval) && $sval == FALSE) {
        $empty[] = $value->getName();
      }
    }
    return $empty;
  }
378871
public function getFrontendCreateFields() {
		$fields = new FieldList();
		$cmsFields = $this->owner->getCMSFields();
		$whitelist = ArrayLib::valuekey($this->owner->stat('frontend_create_fields'));

		// Set for frontend
		HtmlEditorConfig::set_active('multirecordediting_minimal');

		foreach ($cmsFields->dataFields() as $field) {
			if (isset($whitelist[$field->getName()])) {
				if ($field instanceof GridField) {
					$field = $field->transform(new MultiRecordTransformation);
				}
				if ($field instanceof MultiRecordField) {
					$field->setFieldsFunction(__FUNCTION__, true);
				}
				$fields->push($field);
			}
		}

		return $fields;
	}
178204
protected static function getAllFields()
    {
        return FieldsValues::construct(
            [
                self::FIELD_UNIQUE_ID,
                self::FIELD_USERNAME,
                self::FIELD_FIRST_NAME,
                self::FIELD_LAST_NAME,
                self::FIELD_FULL_NAME,
                self::FIELD_EMAIL,
                self::FIELD_DESCRIPTION,
                self::FIELD_LOCATION,
                self::FIELD_PROFILE_URL,
                self::FIELD_IMAGE_URL,
                self::FIELD_WEBSITES,
                self::FIELD_VERIFIED_EMAIL,
                self::FIELD_EXTRA
            ]
        );
    }
630468
public function getProfileFields($profile_type_id) {
    $fields = [];

    // Use storage to get only the profile fields of the current bundle type.
    try {
      $profile_fields = $this->entityTypeManager->getStorage('field_config')->loadByProperties(['entity_type' => 'profile', 'bundle' => $profile_type_id]);
    }
    catch (\Exception $e) {
      return $fields;
    }

    // Loop through the fields and return the necessary values.
    /** @var \Drupal\Core\Field\FieldConfigInterface $profile_field */
    foreach ($profile_fields as $profile_field) {
      // Rewrite the ID a bit, since otherwise config thinks it's an array.
      $id = str_replace('.', '_', $profile_field->id());
      // Build the array.
      $fields[$id] = [
        'id' => $id,
        'name' => $profile_field->getName(),
        'label' => $profile_field->getLabel(),
      ];
    }

    // Return the array of fields.
    return $fields;
  }
645847
protected function getDefaultFields(): array
    {
        $result = [];
        $types = Options::getBasicSearchFieldTypes();

        foreach ($this->searchFields as $field => $properties) {
            if (in_array($properties['type'], $types)) {
                $result[] = $field;
            }
        }

        return $result;
    }
1325078
public function getAllProfileInfo()
    {
        if (empty($this->_profiles)) {
            return '';
        }

        $arrOut = [];
        foreach ($this->_profiles as $name => $val) {
            if (!isset($val['cost'], $val['total'])) {
                continue;
            }
            $arrOut[] = "$name=" . sprintf("%.1f", $val['cost'] * 1000) . '(ms)/' . $val['total'];
        }

        return implode(',', $arrOut);
    }
1164776
public function getFields() {
        if($this->cachedFields == null) {
            $this->cachedFields = $this->createFields();
        }

        return $this->cachedFields;
    }
244110
public function getDataModelSettings()
    {
        if (! $this->exists) {
            return array();
        }

        $fieldSettings = array();

        foreach ($this->_fields as $key => $field) {
            if ($field instanceof FieldInterface) {
                $fieldSettings[$key] = $field->getDataModelSettings();
            }
        }

        return $fieldSettings;
    }
282206
protected function getSortFields()
	{
		return array(
			'a.lft' => JText::_('JGRID_HEADING_ORDERING'),
			'a.published' => JText::_('JSTATUS'),
			'a.title' => JText::_('JGLOBAL_TITLE'),
			'a.access' => JText::_('JGRID_HEADING_ACCESS'),
			'language' => JText::_('JGRID_HEADING_LANGUAGE'),
			'a.id' => JText::_('JGRID_HEADING_ID')
		);
	}