You are here

public function GdprFieldConfigEntity::setField in General Data Protection Regulation 8

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

Sets a GDPR field's settings.

Parameters

\Drupal\gdpr_fields\Entity\GdprField $field: Field settings.

Return value

$this

File

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

Class

GdprFieldConfigEntity
Defines a GDPR Field configuration entity.

Namespace

Drupal\gdpr_fields\Entity

Code

public function setField(GdprField $field) {
  $values = $field
    ->toArray();
  $bundle = $values['bundle'];
  $field_name = $values['name'];
  foreach ($values as $key => $value) {
    $this->bundles[$bundle][$field_name][$key] = $value;
  }
  $this->filenames[$bundle] = $values['sars_filename'];
  return $this;
}