/**
  * {@inheritdoc}
  */
 public function validatePluginInstance(PluginInspectionInterface $plugin_instance)
 {
     $plugin_manager = $this->getPluginType()->getPluginManager();
     if (!$plugin_manager->hasDefinition($plugin_instance->getPluginId())) {
         throw new PluginNotFoundException($plugin_instance->getPluginId(), sprintf('Plugin manager %s does not have a definition for plugin %s.', get_class($plugin_manager), $plugin_instance->getPluginId()));
     }
 }
 /**
  * {@inheritdoc}
  */
 protected function calculatePluginDependencies(PluginInspectionInterface $instance)
 {
     // Only add dependencies for plugins that are enabled.
     // @see \Drupal\userprotect\Plugin\UserProtection\UserProtectionPluginCollection::getConfiguration()
     if (isset($this->protections[$instance->getPluginId()])) {
         parent::calculatePluginDependencies($instance);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function setSelectedPlugin(PluginInspectionInterface $plugin)
 {
     $this->validateSelectablePluginType();
     $this->selectedPlugin = $plugin;
     if ($this->getKeepPreviouslySelectedPlugins()) {
         $this->previouslySelectedPlugins[$plugin->getPluginId()] = $plugin;
     }
     return $this;
 }
Exemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 protected function calculatePluginDependencies(PluginInspectionInterface $instance)
 {
     // Only add dependencies for plugins that are actually configured. This is
     // necessary because the filter plugin collection will return all available
     // filter plugins.
     // @see \Drupal\filter\FilterPluginCollection::getConfiguration()
     if (isset($this->filters[$instance->getPluginId()])) {
         parent::calculatePluginDependencies($instance);
     }
 }