public function FormatterPluginManager::__construct

Constructs a FormatterPluginManager object.

Parameters

\Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations,

File

drupal/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterPluginManager.php, line 36
Definition of Drupal\field\Plugin\Type\Formatter\FormatterPluginManager..

Class

FormatterPluginManager
Plugin type manager for field formatters.

Namespace

Drupal\field\Plugin\Type\Formatter

Code

public function __construct(\Traversable $namespaces) {
  $annotation_namespaces = array(
    'Drupal\\field\\Annotation' => $namespaces['Drupal\\field'],
  );
  $this->discovery = new AnnotatedClassDiscovery('field/formatter', $namespaces, $annotation_namespaces, 'Drupal\\field\\Annotation\\FieldFormatter');
  $this->discovery = new AlterDecorator($this->discovery, 'field_formatter_info');
  $this->discovery = new CacheDecorator($this->discovery, 'field_formatter_types', 'field');
}