You are here

class BlockVariantEvent in Chaos Tool Suite (ctools) 8.3

Hierarchy

  • class \Drupal\ctools\Event\BlockVariantEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of BlockVariantEvent

2 files declare their use of BlockVariantEvent
BlockDisplayVariantTest.php in tests/src/Kernel/BlockDisplayVariantTest.php
BlockVariantTrait.php in src/Plugin/BlockVariantTrait.php

File

src/Event/BlockVariantEvent.php, line 9

Namespace

Drupal\ctools\Event
View source
class BlockVariantEvent extends Event {

  /**
   * The block being acted upon.
   *
   * @var \Drupal\Core\Block\BlockPluginInterface
   */
  protected $block;

  /**
   * The variant acting on the block.
   *
   * @var \Drupal\ctools\Plugin\BlockVariantInterface
   */
  protected $variant;

  /**
   * BlockVariantEvent constructor.
   *
   * @param \Drupal\Core\Block\BlockPluginInterface $block
   *   The block plugin.
   * @param \Drupal\ctools\Plugin\BlockVariantInterface $variant
   *   The variant plugin.
   */
  public function __construct(BlockPluginInterface $block, BlockVariantInterface $variant) {
    $this->block = $block;
    $this->variant = $variant;
  }

  /**
   * Gets the block plugin.
   *
   * @return \Drupal\Core\Block\BlockPluginInterface
   */
  public function getBlock() {
    return $this->block;
  }

  /**
   * Gets the variant plugin.
   *
   * @return \Drupal\ctools\Plugin\BlockVariantInterface
   */
  public function getVariant() {
    return $this->variant;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BlockVariantEvent::$block protected property The block being acted upon.
BlockVariantEvent::$variant protected property The variant acting on the block.
BlockVariantEvent::getBlock public function Gets the block plugin.
BlockVariantEvent::getVariant public function Gets the variant plugin.
BlockVariantEvent::__construct public function BlockVariantEvent constructor.