You are here

private static function GdprFieldSettingsForm::getConfig in General Data Protection Regulation 8.2

Same name and namespace in other branches
  1. 8 modules/gdpr_fields/src/Form/GdprFieldSettingsForm.php \Drupal\gdpr_fields\Form\GdprFieldSettingsForm::getConfig()
  2. 3.0.x modules/gdpr_fields/src/Form/GdprFieldSettingsForm.php \Drupal\gdpr_fields\Form\GdprFieldSettingsForm::getConfig()

Gets the configuration for an entity/bundle/field.

Parameters

string $entity_type: Entity type.

string $bundle: Bundle.

string $field_name: Field.

Return value

\Drupal\gdpr_fields\Entity\GdprField Field metadata.

1 call to GdprFieldSettingsForm::getConfig()
GdprFieldSettingsForm::buildFormFields in modules/gdpr_fields/src/Form/GdprFieldSettingsForm.php
Builds the form fields for GDPR settings.

File

modules/gdpr_fields/src/Form/GdprFieldSettingsForm.php, line 76

Class

GdprFieldSettingsForm
GDPR Field settings.

Namespace

Drupal\gdpr_fields\Form

Code

private static function getConfig($entity_type, $bundle, $field_name) {
  $config = GdprFieldConfigEntity::load($entity_type);
  if ($config === NULL) {
    $config = GdprFieldConfigEntity::create([
      'id' => $entity_type,
    ]);
  }
  return $config
    ->getField($bundle, $field_name);
}