class FilterPluginManager

Manages text processing filters.

Hierarchy

Expanded class hierarchy of FilterPluginManager

See also

hook_filter_info_alter()

1 string reference to 'FilterPluginManager'
filter.services.yml in drupal/core/modules/filter/filter.services.yml
drupal/core/modules/filter/filter.services.yml
1 service uses FilterPluginManager

File

drupal/core/modules/filter/lib/Drupal/filter/FilterPluginManager.php, line 23
Contains \Drupal\filter\FilterPluginManager.

Namespace

Drupal\filter
View source
class FilterPluginManager extends PluginManagerBase {

  /**
   * Constructs a FilterPluginManager object.
   *
   * @param \Traversable $namespaces
   *   An object that implements \Traversable which contains the root paths
   *   keyed by the corresponding namespace to look for plugin implementations.
   */
  public function __construct(\Traversable $namespaces) {
    $annotation_namespaces = array(
      'Drupal\\filter\\Annotation' => $namespaces['Drupal\\filter'],
    );
    $this->discovery = new AnnotatedClassDiscovery('Filter', $namespaces, $annotation_namespaces, 'Drupal\\filter\\Annotation\\Filter');
    $this->discovery = new AlterDecorator($this->discovery, 'filter_info');
    $cache_key = 'filter_plugins:' . language(Language::TYPE_INTERFACE)->langcode;
    $cache_tags = array(
      'filter_formats' => TRUE,
    );
    $this->discovery = new CacheDecorator($this->discovery, $cache_key, 'cache', CacheBackendInterface::CACHE_PERMANENT, $cache_tags);
  }

  /**
   * {@inheritdoc}
   */
  public function createInstance($plugin_id, array $configuration = array(), FilterBag $filter_bag = NULL) {
    $plugin_definition = $this->discovery
      ->getDefinition($plugin_id);
    $plugin_class = DefaultFactory::getPluginClass($plugin_id, $plugin_definition);
    return new $plugin_class($configuration, $plugin_id, $plugin_definition, $filter_bag);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FilterPluginManager::createInstance public function Returns a preconfigured instance of a plugin. Overrides PluginManagerBase::createInstance
FilterPluginManager::__construct public function Constructs a FilterPluginManager object.
PluginManagerBase::$defaults protected property A set of defaults to be referenced by $this->processDefinition() if additional processing of plugins is necessary or helpful for development purposes. 3
PluginManagerBase::$discovery protected property The object that discovers plugins managed by this manager.
PluginManagerBase::$factory protected property The object that instantiates plugins managed by this manager.
PluginManagerBase::$mapper protected property The object that returns the preconfigured plugin instance appropriate for a particular runtime condition.
PluginManagerBase::clearCachedDefinitions public function Clears static and persistent plugin definition caches. Overrides CachedDiscoveryInterface::clearCachedDefinitions
PluginManagerBase::getDefinition public function Gets a specific plugin definition. Overrides DiscoveryInterface::getDefinition
PluginManagerBase::getDefinitions public function Gets the definition of all plugins for this type. Overrides DiscoveryInterface::getDefinitions
PluginManagerBase::getInstance public function Returns a preconfigured instance of a plugin. Overrides MapperInterface::getInstance 6
PluginManagerBase::processDefinition public function Performs extra processing on plugin definitions. 2