You are here

abstract class BaseBlockEvent in Hook Event Dispatcher 8

Class BaseBlockEvent.

Hierarchy

Expanded class hierarchy of BaseBlockEvent

File

src/Event/Block/BaseBlockEvent.php, line 12

Namespace

Drupal\hook_event_dispatcher\Event\Block
View source
abstract class BaseBlockEvent extends Event implements EventInterface {

  /**
   * The build array.
   *
   * @var array
   */
  protected $build;

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

  /**
   * BaseBlockEvent constructor.
   *
   * @param array $build
   *   The build array.
   * @param \Drupal\Core\Block\BlockPluginInterface $block
   *   The block object.
   */
  public function __construct(array &$build, BlockPluginInterface $block) {
    $this->build =& $build;
    $this->block = $block;
  }

  /**
   * Get the build array.
   *
   * @return array
   *   The build array.
   */
  public function &getBuild() {
    return $this->build;
  }

  /**
   * Set the block.
   *
   * @param array $build
   *   The build array.
   *
   * @deprecated This is not needed, the form is passed by reference.
   */
  public function setBuild(array $build) {
    $this->build = $build;
  }

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

}

Members

Namesort descending Modifiers Type Description Overrides
BaseBlockEvent::$block protected property The block.
BaseBlockEvent::$build protected property The build array.
BaseBlockEvent::getBlock public function Get the block.
BaseBlockEvent::getBuild public function Get the build array.
BaseBlockEvent::setBuild Deprecated public function Set the block.
BaseBlockEvent::__construct public function BaseBlockEvent constructor.
EventInterface::getDispatcherType public function Get the dispatcher type. 66