You are here

public function PluginSelectorBase::setSelectablePluginDiscovery in Plugin 8.2

Overrides the plugin type's discovery.

Parameters

\Drupal\Component\Plugin\Discovery\DiscoveryInterface:

Return value

$this

Throws

\RuntimeException Thrown if the plugin type was not set using self::setSelectablePluginType().

Overrides PluginSelectorInterface::setSelectablePluginDiscovery

File

src/Plugin/Plugin/PluginSelector/PluginSelectorBase.php, line 274

Class

PluginSelectorBase
Provides a base plugin selector.

Namespace

Drupal\plugin\Plugin\Plugin\PluginSelector

Code

public function setSelectablePluginDiscovery(DiscoveryInterface $plugin_discovery) {
  $this
    ->validateSelectablePluginType();
  $this->selectablePluginDiscovery = new TypedDefinitionEnsuringPluginDiscoveryDecorator($this->selectablePluginType, $plugin_discovery);
  return $this;
}