function FieldTypePluginManager::__construct

Constructs the FieldTypePluginManager object.

Parameters

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

\Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend instance to use.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Drupal\Core\TypedData\TypedDataManagerInterface $typedDataManager: The typed data manager.

\Drupal\Core\Field\FieldTypeCategoryManagerInterface $fieldTypeCategoryManager: The field type category plugin manager.

Overrides DefaultPluginManager::__construct

File

core/lib/Drupal/Core/Field/FieldTypePluginManager.php, line 40

Class

FieldTypePluginManager
Plugin manager for 'field type' plugins.

Namespace

Drupal\Core\Field

Code

public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, protected ModuleHandlerInterface $module_handler, protected TypedDataManagerInterface $typedDataManager, protected FieldTypeCategoryManagerInterface $fieldTypeCategoryManager) {
  parent::__construct('Plugin/Field/FieldType', $namespaces, $module_handler, FieldItemInterface::class, FieldType::class, 'Drupal\\Core\\Field\\Annotation\\FieldType');
  $this->alterInfo('field_info');
  $this->setCacheBackend($cache_backend, 'field_types_plugins');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.