private function RightToBeForgottenEntityTraversal::getAnonymizerId in General Data Protection Regulation 3.0.x
Same name and namespace in other branches
- 8.2 modules/gdpr_tasks/src/Traversal/RightToBeForgottenEntityTraversal.php \Drupal\gdpr_tasks\Traversal\RightToBeForgottenEntityTraversal::getAnonymizerId()
- 8 modules/gdpr_tasks/src/Traversal/RightToBeForgottenEntityTraversal.php \Drupal\gdpr_tasks\Traversal\RightToBeForgottenEntityTraversal::getAnonymizerId()
Gets the ID of the anonymizer plugin to use on this field.
Parameters
\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The field definition.
\Drupal\gdpr_fields\Entity\GdprField $field_config: GDPR field configuration.
Return value
string The anonymizer ID or null.
1 call to RightToBeForgottenEntityTraversal::getAnonymizerId()
- RightToBeForgottenEntityTraversal::anonymize in modules/
gdpr_tasks/ src/ Traversal/ RightToBeForgottenEntityTraversal.php - Runs anonymize functionality against a field.
File
- modules/
gdpr_tasks/ src/ Traversal/ RightToBeForgottenEntityTraversal.php, line 242
Class
- RightToBeForgottenEntityTraversal
- Entity traversal used for Right to be Forgotten requests.
Namespace
Drupal\gdpr_tasks\TraversalCode
private function getAnonymizerId(FieldDefinitionInterface $field_definition, GdprField $field_config) {
$anonymizer = $field_config->anonymizer;
$type = $field_definition
->getType();
if (!$anonymizer) {
// No anonymizer defined directly on the field.
// Instead try and get one for the datatype.
$anonymizers = [
'string' => 'gdpr_text_anonymizer',
'datetime' => 'gdpr_date_anonymizer',
];
$this->moduleHandler
->alter('gdpr_type_anonymizers', $anonymizers);
$anonymizer = $anonymizers[$type];
}
return $anonymizer;
}