BlockPluginCollection example

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());
    }
    return $this->pluginCollection;
  }

  /** * {@inheritdoc} */
  public function getPluginCollections() {
    return [
      'settings' => $this->getPluginCollection(),
      'visibility' => $this->getVisibilityConditions(),
    ];
Home | Imprint | This part of the site doesn't use cookies.