class BlockVariantEvent

Same name in other branches
  1. 4.0.x src/Event/BlockVariantEvent.php \Drupal\ctools\Event\BlockVariantEvent

Hierarchy

  • class \Drupal\Component\EventDispatcher\Event extends \Symfony\Component\EventDispatcher\Event
    • class \Drupal\ctools\Event\BlockVariantEvent extends \Drupal\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 12

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

Title Sort descending Modifiers Object type Summary
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.