You are here

protected function SocialProfileFieldsFlushForm::getUnselectedFields in Open Social 8.5

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsFlushForm.php \Drupal\social_profile_fields\Form\SocialProfileFieldsFlushForm::getUnselectedFields()
  2. 8.2 modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsFlushForm.php \Drupal\social_profile_fields\Form\SocialProfileFieldsFlushForm::getUnselectedFields()
  3. 8.3 modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsFlushForm.php \Drupal\social_profile_fields\Form\SocialProfileFieldsFlushForm::getUnselectedFields()
  4. 8.4 modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsFlushForm.php \Drupal\social_profile_fields\Form\SocialProfileFieldsFlushForm::getUnselectedFields()
  5. 8.6 modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsFlushForm.php \Drupal\social_profile_fields\Form\SocialProfileFieldsFlushForm::getUnselectedFields()
  6. 8.7 modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsFlushForm.php \Drupal\social_profile_fields\Form\SocialProfileFieldsFlushForm::getUnselectedFields()
  7. 8.8 modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsFlushForm.php \Drupal\social_profile_fields\Form\SocialProfileFieldsFlushForm::getUnselectedFields()
  8. 10.3.x modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsFlushForm.php \Drupal\social_profile_fields\Form\SocialProfileFieldsFlushForm::getUnselectedFields()
  9. 10.0.x modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsFlushForm.php \Drupal\social_profile_fields\Form\SocialProfileFieldsFlushForm::getUnselectedFields()
  10. 10.1.x modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsFlushForm.php \Drupal\social_profile_fields\Form\SocialProfileFieldsFlushForm::getUnselectedFields()
  11. 10.2.x modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsFlushForm.php \Drupal\social_profile_fields\Form\SocialProfileFieldsFlushForm::getUnselectedFields()

Function that return an array of field names.

Return value

array An array of field names.

2 calls to SocialProfileFieldsFlushForm::getUnselectedFields()
SocialProfileFieldsFlushForm::getDescription in modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsFlushForm.php
Returns additional text to display as a description.
SocialProfileFieldsFlushForm::submitForm in modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsFlushForm.php
Form submission handler.

File

modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsFlushForm.php, line 140

Class

SocialProfileFieldsFlushForm
Class SocialProfileFieldsFlushForm.

Namespace

Drupal\social_profile_fields\Form

Code

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;
}