You are here

public function EntityViewAlterEvent::__construct in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/core_event_dispatcher/src/Event/Entity/EntityViewAlterEvent.php \Drupal\core_event_dispatcher\Event\Entity\EntityViewAlterEvent::__construct()

EntityViewAlterEventEvent constructor.

Parameters

array &$build: A renderable array representing the entity content. The module may add elements to $build prior to rendering. The structure of $build is a renderable array as expected by drupal_render().

\Drupal\Core\Entity\EntityInterface $entity: The entity object.

\Drupal\Core\Entity\Display\EntityViewDisplayInterface $display: The entity view display holding the display options configured for the entity components.

Overrides AbstractEntityEvent::__construct

File

modules/core_event_dispatcher/src/Event/Entity/EntityViewAlterEvent.php, line 40

Class

EntityViewAlterEvent
Class EntityViewAlterEventEvent.

Namespace

Drupal\core_event_dispatcher\Event\Entity

Code

public function __construct(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
  parent::__construct($entity);
  $this->build =& $build;
  $this->display = $display;
}