You are here

class PanelsDisplayVariant in Panels 8.3

Same name and namespace in other branches
  1. 8.4 src/Plugin/DisplayVariant/PanelsDisplayVariant.php \Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant

Provides a display variant that simply contains blocks.

Plugin annotation


@DisplayVariant(
  id = "panels_variant",
  admin_label = @Translation("Panels")
)

Hierarchy

Expanded class hierarchy of PanelsDisplayVariant

27 files declare their use of PanelsDisplayVariant
DisplayBuilderBase.php in src/Plugin/DisplayBuilder/DisplayBuilderBase.php
DisplayBuilderInterface.php in src/Plugin/DisplayBuilder/DisplayBuilderInterface.php
InPlaceEditorDisplayBuilder.php in panels_ipe/src/Plugin/DisplayBuilder/InPlaceEditorDisplayBuilder.php
IPEAccessInterface.php in panels_ipe/src/Plugin/IPEAccessInterface.php
Contains \Drupal\panels_ipe\Plugin\IPEAccessInterface.php.
IPEAccessManager.php in panels_ipe/src/Plugin/IPEAccessManager.php
Contains \Drupal\panels_ipe\Plugin\IPEAccessManager.

... See full list

File

src/Plugin/DisplayVariant/PanelsDisplayVariant.php, line 40

Namespace

Drupal\panels\Plugin\DisplayVariant
View source
class PanelsDisplayVariant extends BlockDisplayVariant implements PluginWizardInterface {

  /**
   * The module handler.
   *
   * @var \Drupal\Core\Extension\ModuleHandlerInterface
   */
  protected $moduleHandler;

  /**
   * The display builder plugin manager.
   *
   * @var \Drupal\panels\Plugin\DisplayBuilder\DisplayBuilderManagerInterface
   */
  protected $builderManager;

  /**
   * The display builder plugin.
   *
   * @var \Drupal\panels\Plugin\DisplayBuilder\DisplayBuilderInterface
   */
  protected $builder;

  /**
   * The layout plugin manager.
   *
   * @var \Drupal\layout_plugin\Plugin\Layout\LayoutPluginManagerInterface;
   */
  protected $layoutManager;

  /**
   * The layout plugin.
   *
   * @var \Drupal\layout_plugin\Plugin\Layout\LayoutInterface
   */
  protected $layout;

  /**
   * Constructs a new PanelsDisplayVariant.
   *
   * @param array $configuration
   *   A configuration array containing information about the plugin instance.
   * @param string $plugin_id
   *   The plugin ID for the plugin instance.
   * @param mixed $plugin_definition
   *   The plugin implementation definition.
   * @param \Drupal\Core\Plugin\Context\ContextHandlerInterface $context_handler
   *   The context handler.
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The current user.
   * @param \Drupal\Component\Uuid\UuidInterface $uuid_generator
   *   The UUID generator.
   * @param \Drupal\Core\Utility\Token $token
   *   The token service.
   * @param \Drupal\Core\Block\BlockManager $block_manager
   *   The block manager.
   * @param \Drupal\Core\Condition\ConditionManager $condition_manager
   *   The condition manager.
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
   *   The module handler.
   * @param \Drupal\panels\Plugin\DisplayBuilder\DisplayBuilderManagerInterface $builder_manager
   *   The display builder plugin manager.
   * @param \Drupal\layout_plugin\Plugin\Layout\LayoutPluginManagerInterface $layout_manager
   *   The layout plugin manager.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, ContextHandlerInterface $context_handler, AccountInterface $account, UuidInterface $uuid_generator, Token $token, BlockManager $block_manager, ConditionManager $condition_manager, ModuleHandlerInterface $module_handler, DisplayBuilderManagerInterface $builder_manager, LayoutPluginManagerInterface $layout_manager) {
    $this->moduleHandler = $module_handler;
    $this->builderManager = $builder_manager;
    $this->layoutManager = $layout_manager;
    parent::__construct($configuration, $plugin_id, $plugin_definition, $context_handler, $account, $uuid_generator, $token, $block_manager, $condition_manager);
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($configuration, $plugin_id, $plugin_definition, $container
      ->get('context.handler'), $container
      ->get('current_user'), $container
      ->get('uuid'), $container
      ->get('token'), $container
      ->get('plugin.manager.block'), $container
      ->get('plugin.manager.condition'), $container
      ->get('module_handler'), $container
      ->get('plugin.manager.panels.display_builder'), $container
      ->get('plugin.manager.layout_plugin'));
  }

  /**
   * Returns the builder assigned to this display variant.
   *
   * @return \Drupal\panels\Plugin\DisplayBuilder\DisplayBuilderInterface
   *   A display builder plugin instance.
   */
  public function getBuilder() {
    if (!isset($this->builder)) {
      if (empty($this->configuration['builder'])) {
        $this->builder = $this->builderManager
          ->createInstance('standard', []);
      }
      else {
        $this->builder = $this->builderManager
          ->createInstance($this->configuration['builder'], []);
      }
    }
    return $this->builder;
  }

  /**
   * Assigns a builder to this display variant.
   *
   * @param string|\Drupal\panels\Plugin\DisplayBuilder\DisplayBuilderInterface $builder
   *   The builder object or plugin id.
   *
   * @return $this
   *
   * @throws \Exception
   *   If $build isn't a string or DisplayBuilderInterface object.
   */
  public function setBuilder($builder) {
    if ($builder instanceof DisplayBuilderInterface) {
      $this->builder = $builder;
      $this->configuration['builder'] = $builder
        ->getPluginId();
    }
    elseif (is_string($builder)) {
      $this->builder = NULL;
      $this->configuration['builder'] = $builder;
    }
    else {
      throw new \Exception("Builder must be a string or DisplayBuilderInterface object");
    }
    return $this;
  }

  /**
   * Returns instance of the layout plugin used by this page variant.
   *
   * @return \Drupal\layout_plugin\Plugin\Layout\LayoutInterface
   *   A layout plugin instance.
   */
  public function getLayout() {
    if (!isset($this->layout)) {
      $this->layout = $this->layoutManager
        ->createInstance($this->configuration['layout'], $this->configuration['layout_settings']);
    }
    return $this->layout;
  }

  /**
   * Assigns the layout plugin to this variant.
   *
   * @param string|\Drupal\layout_plugin\Plugin\Layout\LayoutInterface $layout
   *   The layout plugin object or plugin id.
   * @param array $layout_settings
   *   The layout configuration.
   *
   * @return $this
   *
   * @throws \Exception
   *   If $layout isn't a string or LayoutInterface object.
   */
  public function setLayout($layout, array $layout_settings = []) {
    if ($layout instanceof LayoutInterface) {
      $this->layout = $layout;
      $this->configuration['layout'] = $layout
        ->getPluginId();
      $this->configuration['layout_settings'] = $layout_settings;
    }
    elseif (is_string($layout)) {
      $this->layout = NULL;
      $this->configuration['layout'] = $layout;
      $this->configuration['layout_settings'] = $layout_settings;
    }
    else {
      throw new \Exception("Layout must be a string or LayoutInterface object");
    }
    return $this;
  }

  /**
   * Gets the assigned PanelsPattern or falls back to the default pattern.
   *
   * @return \Drupal\panels\Plugin\PanelsPattern\PanelsPatternInterface
   */
  public function getPattern() {
    if (!isset($this->pattern)) {
      if (empty($this->configuration['pattern'])) {
        $this->pattern = \Drupal::service('plugin.manager.panels.pattern')
          ->createInstance('default');
      }
      else {
        $this->pattern = \Drupal::service('plugin.manager.panels.pattern')
          ->createInstance($this->configuration['pattern']);
      }
    }
    return $this->pattern;
  }

  /**
   * Assign the pattern for panels content operations and default contexts.
   *
   * @param mixed string|\Drupal\panels\Plugin\PanelsPattern\PanelsPatternInterface $pattern
   *
   * @return $this
   *
   * @throws \Exception
   *   If $pattern isn't a string or PanelsPatternInterface object.
   */
  public function setPattern($pattern) {
    if ($pattern instanceof PanelsPatternInterface) {
      $this->pattern = $pattern;
      $this->configuration['pattern'] = $pattern
        ->getPluginId();
    }
    elseif (is_string($pattern)) {
      $this->pattern = NULL;
      $this->configuration['pattern'] = $pattern;
    }
    else {
      throw new \Exception("Pattern must be a string or PanelsPatternInterface object");
    }
    return $this;
  }

  /**
   * Configures how this Panel is being stored.
   *
   * @param string $type
   *   The storage type used by the storage plugin.
   * @param string $id
   *   The id within the storage plugin for this Panels display.
   *
   * @return $this
   */
  public function setStorage($type, $id) {
    $this->configuration['storage_type'] = $type;
    $this->configuration['storage_id'] = $id;
    return $this;
  }

  /**
   * Gets the id of the storage plugin which can save this.
   *
   * @return string|NULL
   */
  public function getStorageType() {
    return $this->configuration['storage_type'] ?: NULL;
  }

  /**
   * Gets id within the storage plugin for this Panels display.
   *
   * @return string|NULL
   */
  public function getStorageId() {
    return $this->configuration['storage_id'] ?: NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function getRegionNames() {
    return $this
      ->getLayout()
      ->getPluginDefinition()['region_names'];
  }

  /**
   * Returns the configured page title.
   *
   * @return string
   */
  public function getPageTitle() {
    return $this->configuration['page_title'];
  }

  /**
   * Sets the page title.
   *
   * @param string $title
   *   The desired page title.
   *
   * @return $this
   */
  public function setPageTitle($title) {
    $this->configuration['page_title'] = $title;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function build() {
    $build = $this
      ->getBuilder()
      ->build($this);
    $build['#title'] = $this
      ->renderPageTitle($this->configuration['page_title']);

    // Allow other module to alter the built panel.
    $this->moduleHandler
      ->alter('panels_build', $build, $this);
    return $build;
  }

  /**
   * {@inheritdoc}
   */
  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {

    // Don't call VariantBase::buildConfigurationForm() on purpose, because it
    // adds a 'Label' field that we don't actually want to use - we store the
    // label on the page variant entity.
    // $form = parent::buildConfigurationForm($form, $form_state);.
    $plugins = $this->builderManager
      ->getDefinitions();
    $options = array();
    foreach ($plugins as $id => $plugin) {
      $options[$id] = $plugin['label'];
    }

    // Only allow the IPE if the storage information is set.
    if (!$this
      ->getStorageType()) {
      unset($options['ipe']);
    }
    $form['builder'] = [
      '#title' => $this
        ->t('Builder'),
      '#type' => 'select',
      '#options' => $options,
      '#default_value' => !empty($this->configuration['builder']) ? $this->configuration['builder'] : 'standard',
    ];
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
    parent::submitConfigurationForm($form, $form_state);
    if ($form_state
      ->hasValue('builder')) {
      $this->configuration['builder'] = $form_state
        ->getValue('builder');
    }
    $this->configuration['page_title'] = $form_state
      ->getValue('page_title');
  }

  /**
   * {@inheritdoc}
   */
  public function access(AccountInterface $account = NULL) {

    // If no blocks are configured for this variant, deny access.
    if (empty($this->configuration['blocks'])) {
      return FALSE;
    }
    return parent::access($account);
  }

  /**
   * {@inheritdoc}
   */
  public function defaultConfiguration() {
    return parent::defaultConfiguration() + [
      'uuid' => $this
        ->uuidGenerator()
        ->generate(),
      'layout' => '',
      'layout_settings' => [],
      'page_title' => '',
      'storage_type' => '',
      'storage_id' => '',
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function getWizardOperations($cached_values) {
    $operations = [];
    $operations['layout'] = [
      'title' => $this
        ->t('Layout'),
      'form' => LayoutPluginSelector::class,
    ];
    if (!empty($this
      ->getConfiguration()['layout']) && $cached_values['plugin']
      ->getLayout() instanceof PluginFormInterface) {

      /** @var \Drupal\layout_plugin\Plugin\Layout\LayoutInterface $layout */
      if (empty($cached_values['layout_change']['new_layout'])) {
        $layout = $cached_values['plugin']
          ->getLayout();
        $r = new \ReflectionClass(get_class($layout));
      }
      else {
        $layout_definition = \Drupal::service('plugin.manager.layout_plugin')
          ->getDefinition($cached_values['layout_change']['new_layout']);
        $r = new \ReflectionClass($layout_definition['class']);
      }

      // If the layout uses the LayoutBase::buildConfigurationForm() method we
      // know it is not truly UI configurable, so there's no reason to include
      // the wizard step for displaying that UI.
      $method = $r
        ->getMethod('buildConfigurationForm');
      if ($method->class != 'Drupal\\layout_plugin\\Plugin\\Layout\\LayoutBase') {
        $operations['settings'] = [
          'title' => $this
            ->t('Layout Settings'),
          'form' => LayoutChangeSettings::class,
        ];
      }
    }
    if (!empty($cached_values['layout_change']['old_layout'])) {
      $operations['regions'] = [
        'title' => $this
          ->t('Layout Regions'),
        'form' => LayoutChangeRegions::class,
      ];
    }

    /** @var \Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant $plugin */
    $plugin = $cached_values['plugin'];
    $builder = $plugin
      ->getBuilder();
    if ($builder instanceof PluginWizardInterface) {
      $operations = array_merge($operations, $builder
        ->getWizardOperations($cached_values));
    }
    return $operations;
  }

  /**
   * {@inheritdoc}
   */
  public function setConfiguration(array $configuration) {
    if (empty($configuration['uuid'])) {
      $configuration['uuid'] = $this
        ->uuidGenerator()
        ->generate();
    }

    // Make sure blocks are mapped to valid regions, and if not, map them to the
    // first available region. This is a work-around the fact that we're not
    // totally in control of the block placement UI from page_manager.
    // @todo Replace after https://www.drupal.org/node/2550879
    if (!empty($configuration['layout']) && !empty($configuration['blocks'])) {
      $layout_definition = $this->layoutManager
        ->getDefinition($configuration['layout']);
      $valid_regions = $layout_definition['regions'];
      $first_region = array_keys($valid_regions)[0];
      foreach ($configuration['blocks'] as &$block) {
        if (!isset($valid_regions[$block['region']])) {
          $block['region'] = $first_region;
        }
      }
    }
    return parent::setConfiguration($configuration);
  }

  /**
   * Renders the page title and replaces tokens.
   *
   * @param string $page_title
   *   The page title that should be rendered.
   *
   * @return string
   *   The page title after replacing any tokens.
   */
  protected function renderPageTitle($page_title) {
    $data = $this
      ->getContextAsTokenData();

    // Token replace only escapes replacement values, ensure a consistent
    // behavior by also escaping the input and then returning it as a Markup
    // object to avoid double escaping.
    // @todo: Simplify this when core provides an API for this in
    //   https://www.drupal.org/node/2580723.
    $title = (string) $this->token
      ->replace(new HtmlEscapedText($page_title), $data);
    return Markup::create($title);
  }

  /**
   * Returns available context as token data.
   *
   * @return array
   *   An array with token data values keyed by token type.
   */
  protected function getContextAsTokenData() {
    $data = array();
    foreach ($this
      ->getContexts() as $context) {

      // @todo Simplify this when token and typed data types are unified in
      //   https://drupal.org/node/2163027.
      if (strpos($context
        ->getContextDefinition()
        ->getDataType(), 'entity:') === 0) {
        $token_type = substr($context
          ->getContextDefinition()
          ->getDataType(), 7);
        if ($token_type == 'taxonomy_term') {
          $token_type = 'term';
        }
        $data[$token_type] = $context
          ->getContextValue();
      }
    }
    return $data;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AjaxFormTrait::getAjaxAttributes public static function Gets attributes for use with an AJAX modal.
AjaxFormTrait::getAjaxButtonAttributes public static function Gets attributes for use with an add button AJAX modal.
BlockDisplayVariant::$account protected property The current user.
BlockDisplayVariant::$contextHandler protected property The context handler.
BlockDisplayVariant::$contexts protected property An array of collected contexts.
BlockDisplayVariant::$token protected property The token service.
BlockDisplayVariant::$uuidGenerator protected property The UUID generator.
BlockDisplayVariant::calculateDependencies public function Calculates dependencies for the configured plugin. Overrides VariantBase::calculateDependencies
BlockDisplayVariant::contextHandler protected function
BlockDisplayVariant::getBlockConfig protected function Returns the configuration for stored blocks. Overrides BlockVariantTrait::getBlockConfig
BlockDisplayVariant::getConfiguration public function Gets this plugin's configuration. Overrides VariantBase::getConfiguration
BlockDisplayVariant::getContexts public function Gets the contexts. Overrides ContextAwareVariantInterface::getContexts
BlockDisplayVariant::setContexts public function Sets the contexts. Overrides ContextAwareVariantInterface::setContexts
BlockDisplayVariant::uuidGenerator protected function Returns the UUID generator. Overrides BlockVariantTrait::uuidGenerator
BlockDisplayVariant::__sleep public function Overrides DependencySerializationTrait::__sleep
BlockVariantTrait::$blockManager protected property The block manager.
BlockVariantTrait::$blockPluginCollection protected property The plugin collection that holds the block plugins.
BlockVariantTrait::$eventDispatcher protected property The event dispatcher.
BlockVariantTrait::addBlock public function
BlockVariantTrait::eventDispatcher protected function Gets the event dispatcher.
BlockVariantTrait::getBlock public function
BlockVariantTrait::getBlockCollection protected function Returns the block plugins used for this display variant.
BlockVariantTrait::getBlockManager protected function Gets the block plugin manager.
BlockVariantTrait::getRegionAssignment public function
BlockVariantTrait::getRegionAssignments public function
BlockVariantTrait::getRegionName public function
BlockVariantTrait::removeBlock public function
BlockVariantTrait::updateBlock public function
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::getCacheContexts public function 3
CacheableDependencyTrait::getCacheMaxAge public function 3
CacheableDependencyTrait::getCacheTags public function 3
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__wakeup public function 2
DependencyTrait::$dependencies protected property The object's dependencies.
DependencyTrait::addDependencies protected function Adds multiple dependencies.
DependencyTrait::addDependency protected function Adds a dependency.
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PanelsDisplayVariant::$builder protected property The display builder plugin.
PanelsDisplayVariant::$builderManager protected property The display builder plugin manager.
PanelsDisplayVariant::$layout protected property The layout plugin.
PanelsDisplayVariant::$layoutManager protected property The layout plugin manager.
PanelsDisplayVariant::$moduleHandler protected property The module handler.
PanelsDisplayVariant::access public function Determines if this display variant is accessible. Overrides VariantBase::access
PanelsDisplayVariant::build public function Builds and returns the renderable array for the display variant. Overrides VariantInterface::build
PanelsDisplayVariant::buildConfigurationForm public function Form constructor. Overrides VariantBase::buildConfigurationForm
PanelsDisplayVariant::create public static function Creates an instance of the plugin. Overrides BlockDisplayVariant::create
PanelsDisplayVariant::defaultConfiguration public function Gets default configuration for this plugin. Overrides BlockDisplayVariant::defaultConfiguration
PanelsDisplayVariant::getBuilder public function Returns the builder assigned to this display variant.
PanelsDisplayVariant::getContextAsTokenData protected function Returns available context as token data.
PanelsDisplayVariant::getLayout public function Returns instance of the layout plugin used by this page variant.
PanelsDisplayVariant::getPageTitle public function Returns the configured page title.
PanelsDisplayVariant::getPattern public function Gets the assigned PanelsPattern or falls back to the default pattern.
PanelsDisplayVariant::getRegionNames public function Overrides BlockVariantTrait::getRegionNames
PanelsDisplayVariant::getStorageId public function Gets id within the storage plugin for this Panels display.
PanelsDisplayVariant::getStorageType public function Gets the id of the storage plugin which can save this.
PanelsDisplayVariant::getWizardOperations public function Retrieve a list of FormInterface classes by their step key in the wizard. Overrides PluginWizardInterface::getWizardOperations
PanelsDisplayVariant::renderPageTitle protected function Renders the page title and replaces tokens.
PanelsDisplayVariant::setBuilder public function Assigns a builder to this display variant.
PanelsDisplayVariant::setConfiguration public function Sets the configuration for this plugin instance. Overrides BlockDisplayVariant::setConfiguration
PanelsDisplayVariant::setLayout public function Assigns the layout plugin to this variant.
PanelsDisplayVariant::setPageTitle public function Sets the page title.
PanelsDisplayVariant::setPattern public function Assign the pattern for panels content operations and default contexts.
PanelsDisplayVariant::setStorage public function Configures how this Panel is being stored.
PanelsDisplayVariant::submitConfigurationForm public function Form submission handler. Overrides VariantBase::submitConfigurationForm
PanelsDisplayVariant::__construct public function Constructs a new PanelsDisplayVariant. Overrides BlockDisplayVariant::__construct
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginDependencyTrait::calculatePluginDependencies protected function Calculates and adds dependencies of a specific plugin instance. 1
PluginDependencyTrait::getPluginDependencies protected function Calculates and returns dependencies of a specific plugin instance.
PluginDependencyTrait::moduleHandler protected function Wraps the module handler. 1
PluginDependencyTrait::themeHandler protected function Wraps the theme handler. 1
RefinableCacheableDependencyTrait::addCacheableDependency public function 1
RefinableCacheableDependencyTrait::addCacheContexts public function
RefinableCacheableDependencyTrait::addCacheTags public function
RefinableCacheableDependencyTrait::mergeCacheMaxAge public function
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
VariantBase::adminLabel public function Returns the admin-facing display variant label. Overrides VariantInterface::adminLabel
VariantBase::getWeight public function Returns the weight of the display variant. Overrides VariantInterface::getWeight
VariantBase::id public function Returns the unique ID for the display variant. Overrides VariantInterface::id
VariantBase::label public function Returns the user-facing display variant label. Overrides VariantInterface::label
VariantBase::setWeight public function Sets the weight of the display variant. Overrides VariantInterface::setWeight
VariantBase::validateConfigurationForm public function Form validation handler. Overrides PluginFormInterface::validateConfigurationForm