You are here

protected function PageVariant::getVariantPluginCollection in Page Manager 8

Same name and namespace in other branches
  1. 8.4 src/Entity/PageVariant.php \Drupal\page_manager\Entity\PageVariant::getVariantPluginCollection()

Get the plugin collection that holds the single variant plugin instance.

Return value

\Drupal\Core\Plugin\DefaultSingleLazyPluginCollection The plugin collection that holds the single variant plugin instance.

1 call to PageVariant::getVariantPluginCollection()
PageVariant::getPluginCollections in src/Entity/PageVariant.php
Gets the plugin collections used by this object.

File

src/Entity/PageVariant.php, line 221
Contains Drupal\page_manager\Entity\PageVariant.

Class

PageVariant
Defines the page variant entity.

Namespace

Drupal\page_manager\Entity

Code

protected function getVariantPluginCollection() {
  if (!$this->variantPluginCollection) {
    if (empty($this->variant_settings['uuid'])) {
      $this->variant_settings['uuid'] = $this
        ->uuidGenerator()
        ->generate();
    }
    $this->variantPluginCollection = new DefaultSingleLazyPluginCollection(\Drupal::service('plugin.manager.display_variant'), $this->variant, $this->variant_settings);
  }
  return $this->variantPluginCollection;
}