You are here

class PanelsVariantEvent in Panels 8.4

Event object for events relating to Panels display variants.

Hierarchy

Expanded class hierarchy of PanelsVariantEvent

2 files declare their use of PanelsVariantEvent
PanelsStorageManager.php in src/Storage/PanelsStorageManager.php
PanelsStorageManagerTest.php in tests/src/Kernel/PanelsStorageManagerTest.php

File

src/PanelsVariantEvent.php, line 11

Namespace

Drupal\panels
View source
class PanelsVariantEvent extends Event {

  /**
   * The Panels display variant.
   *
   * @var \Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant
   */
  protected $variant;

  /**
   * PanelsVariantEvent constructor.
   *
   * @param \Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant $variant
   *   The Panels display variant.
   */
  public function __construct(PanelsDisplayVariant $variant) {
    $this->variant = $variant;
  }

  /**
   * Returns the Panels display variant that triggered the event.
   *
   * @return \Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant
   *   The Panels display variant.
   */
  public function getVariant() {
    return $this->variant;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PanelsVariantEvent::$variant protected property The Panels display variant.
PanelsVariantEvent::getVariant public function Returns the Panels display variant that triggered the event.
PanelsVariantEvent::__construct public function PanelsVariantEvent constructor.