getPluginCollection example

protected function getPluginCollection() {
    if (!$this->pluginCollection) {
      $this->pluginCollection = new ActionPluginCollection(\Drupal::service('plugin.manager.action')$this->plugin, $this->configuration);
    }
    return $this->pluginCollection;
  }

  /** * {@inheritdoc} */
  public function getPluginCollections() {
    return ['configuration' => $this->getPluginCollection()];
  }

  /** * {@inheritdoc} */
  public function getPlugin() {
    return $this->getPluginCollection()->get($this->plugin);
  }

  /** * {@inheritdoc} */
$missing_states = array_diff($workflow_type->getRequiredStates()array_keys($this->getTypePlugin()->getStates()));
    if (!empty($missing_states)) {
      throw new RequiredStateMissingException(sprintf("Workflow type '{$workflow_type->label()}' requires states with the ID '%s' in workflow '{$this->id()}'", implode("', '", $missing_states)));
    }
    parent::preSave($storage);
  }

  /** * {@inheritdoc} */
  public function getTypePlugin() {
    return $this->getPluginCollection()->get($this->type);
  }

  /** * {@inheritdoc} */
  public function getPluginCollections() {
    return ['type_settings' => $this->getPluginCollection()];
  }

  /** * Encapsulates the creation of the workflow's plugin collection. * * @return \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection * The workflow's plugin collection. */
/** * The theme that includes the block plugin for this entity. * * @var string */
  protected $theme;

  /** * {@inheritdoc} */
  public function getPlugin() {
    return $this->getPluginCollection()->get($this->plugin);
  }

  /** * Encapsulates the creation of the block's LazyPluginCollection. * * @return \Drupal\Component\Plugin\LazyPluginCollection * The block's plugin collection. */
  protected function getPluginCollection() {
    if (!$this->pluginCollection) {
      $this->pluginCollection = new BlockPluginCollection(\Drupal::service('plugin.manager.block')$this->plugin, $this->get('settings')$this->id());
    }
/** * The plugin collection that stores search plugins. * * @var \Drupal\search\Plugin\SearchPluginCollection */
  protected $pluginCollection;

  /** * {@inheritdoc} */
  public function getPlugin() {
    return $this->getPluginCollection()->get($this->plugin);
  }

  /** * Encapsulates the creation of the search page's LazyPluginCollection. * * @return \Drupal\Component\Plugin\LazyPluginCollection * The search page's plugin collection. */
  protected function getPluginCollection() {
    if (!$this->pluginCollection) {
      $this->pluginCollection = new SearchPluginCollection($this->searchPluginManager()$this->plugin, $this->configuration, $this->id());
    }
Home | Imprint | This part of the site doesn't use cookies.