EmailAnonymizer.php in General Data Protection Regulation 8
Same filename and directory in other branches
Namespace
Drupal\anonymizer\Plugin\AnonymizerFile
modules/anonymizer/src/Plugin/Anonymizer/EmailAnonymizer.phpView source
<?php
namespace Drupal\anonymizer\Plugin\Anonymizer;
use Drupal\anonymizer\Anonymizer\AnonymizerBase;
use Drupal\Core\Field\FieldItemListInterface;
/**
* Class EmailAnonymizer.
*
* @Anonymizer(
* id = "email_anonymizer",
* label = @Translation("Email anonymizer"),
* description = @Translation("Provides anonymization functionality intended to be used for emails.")
* )
*
* @package Drupal\anonymizer\Plugin\Anonymizer
*/
class EmailAnonymizer extends AnonymizerBase {
/**
* {@inheritdoc}
*/
public function anonymize($input, FieldItemListInterface $field = NULL) {
return $this->faker
->generator()
->unique()->safeEmail;
}
}
Classes
Name | Description |
---|---|
EmailAnonymizer | Class EmailAnonymizer. |