You are here

public function GdprFieldConfigEntity::getAllFields in General Data Protection Regulation 8.2

Same name and namespace in other branches
  1. 8 modules/gdpr_fields/src/Entity/GdprFieldConfigEntity.php \Drupal\gdpr_fields\Entity\GdprFieldConfigEntity::getAllFields()
  2. 3.0.x modules/gdpr_fields/src/Entity/GdprFieldConfigEntity.php \Drupal\gdpr_fields\Entity\GdprFieldConfigEntity::getAllFields()

Gets all GDPR field settings for this entity type.

Return value

\Drupal\gdpr_fields\Entity\GdprField[] Array of GDPR field settings. Keys are in the format of "bundle.fieldname".

File

modules/gdpr_fields/src/Entity/GdprFieldConfigEntity.php, line 120

Class

GdprFieldConfigEntity
Defines a GDPR Field configuration entity.

Namespace

Drupal\gdpr_fields\Entity

Code

public function getAllFields() {
  $results = [];
  foreach ($this->bundles as $bundle_id => $fields_in_bundle) {
    foreach (array_keys($fields_in_bundle) as $field_name) {
      $results["{$bundle_id}.{$field_name}"] = $this
        ->getField($bundle_id, $field_name);
    }
  }
  return $results;
}