class AnonymizerFactory in General Data Protection Regulation 8
Same name and namespace in other branches
- 8.2 modules/anonymizer/src/Anonymizer/AnonymizerFactory.php \Drupal\anonymizer\Anonymizer\AnonymizerFactory
- 3.0.x modules/anonymizer/src/Anonymizer/AnonymizerFactory.php \Drupal\anonymizer\Anonymizer\AnonymizerFactory
Class AnonymizerFactory.
@package Drupal\anonymizer\Anonymizer
Hierarchy
- class \Drupal\anonymizer\Anonymizer\AnonymizerFactory
Expanded class hierarchy of AnonymizerFactory
2 files declare their use of AnonymizerFactory
- GdprSqlDump.php in modules/
gdpr_dump/ src/ Service/ GdprSqlDump.php - RightToBeForgottenEntityTraversal.php in modules/
gdpr_tasks/ src/ Traversal/ RightToBeForgottenEntityTraversal.php
1 string reference to 'AnonymizerFactory'
- anonymizer.services.yml in modules/
anonymizer/ anonymizer.services.yml - modules/anonymizer/anonymizer.services.yml
1 service uses AnonymizerFactory
File
- modules/
anonymizer/ src/ Anonymizer/ AnonymizerFactory.php, line 10
Namespace
Drupal\anonymizer\AnonymizerView source
class AnonymizerFactory {
/**
* Anonymizer instances keyed by their ID.
*
* @var \Drupal\anonymizer\Anonymizer\AnonymizerInterface[]
*/
protected $anonymizers = [];
/**
* The anonymizer plugin manager.
*
* @var \Drupal\anonymizer\Anonymizer\AnonymizerPluginManager
*/
protected $pluginManager;
/**
* AnonymizerFactory constructor.
*
* @param \Drupal\anonymizer\Anonymizer\AnonymizerPluginManager $pluginManager
* The anonymizer plugin manager.
*/
public function __construct(AnonymizerPluginManager $pluginManager) {
$this->pluginManager = $pluginManager;
}
/**
* Gets all anonymizers currently registered.
*/
public function getDefinitions() {
return $this->pluginManager
->getDefinitions();
}
/**
* Get an instance of a anonymizer.
*
* @param string $name
* Anonymizer name.
*
* @return \Drupal\anonymizer\Anonymizer\AnonymizerInterface
* The anonymizer instance.
*
* @throws \Drupal\Component\Plugin\Exception\PluginException
*/
public function get($name) {
if (!isset($this->anonymizers[$name])) {
$this->anonymizers[$name] = $this->pluginManager
->createInstance($name);
}
return $this->anonymizers[$name];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AnonymizerFactory:: |
protected | property | Anonymizer instances keyed by their ID. | |
AnonymizerFactory:: |
protected | property | The anonymizer plugin manager. | |
AnonymizerFactory:: |
public | function | Get an instance of a anonymizer. | |
AnonymizerFactory:: |
public | function | Gets all anonymizers currently registered. | |
AnonymizerFactory:: |
public | function | AnonymizerFactory constructor. |