You are here

public function AnonymizerFactory::get in General Data Protection Regulation 8.2

Same name and namespace in other branches
  1. 8 modules/anonymizer/src/Anonymizer/AnonymizerFactory.php \Drupal\anonymizer\Anonymizer\AnonymizerFactory::get()
  2. 3.0.x modules/anonymizer/src/Anonymizer/AnonymizerFactory.php \Drupal\anonymizer\Anonymizer\AnonymizerFactory::get()

Get an instance of a anonymizer.

Parameters

string $name: Anonymizer name.

Return value

\Drupal\anonymizer\Anonymizer\AnonymizerInterface The anonymizer instance.

Throws

\Drupal\Component\Plugin\Exception\PluginException

File

modules/anonymizer/src/Anonymizer/AnonymizerFactory.php, line 54

Class

AnonymizerFactory
Class AnonymizerFactory.

Namespace

Drupal\anonymizer\Anonymizer

Code

public function get($name) {
  if (!isset($this->anonymizers[$name])) {
    $this->anonymizers[$name] = $this->pluginManager
      ->createInstance($name);
  }
  return $this->anonymizers[$name];
}