You are here

public function LimitedPluginDiscoveryDecorator::setDiscoveryLimit in Plugin 8.2

Limits the plugins to discover.

If this filter is set, any action for any plugin ID that is not part of the filter must result in a \Drupal\Component\Plugin\Exception\PluginNotFoundException being thrown.

Parameters

string[] $plugin_ids: An array of plugin IDs or TRUE to allow all.

Return value

$this

Overrides LimitedPluginDiscoveryInterface::setDiscoveryLimit

File

src/PluginDiscovery/LimitedPluginDiscoveryDecorator.php, line 33

Class

LimitedPluginDiscoveryDecorator
Provides a filtered plugin manager.

Namespace

Drupal\plugin\PluginDiscovery

Code

public function setDiscoveryLimit(array $plugin_ids) {
  $this->discoveryLimit = $plugin_ids;
  return $this;
}