public function EntityViewEvent::__construct in Hook Event Dispatcher 3.x
Same name and namespace in other branches
- 8.2 modules/core_event_dispatcher/src/Event/Entity/EntityViewEvent.php \Drupal\core_event_dispatcher\Event\Entity\EntityViewEvent::__construct()
EntityViewEvent 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.
string $viewMode: The view mode the entity is rendered in.
Overrides AbstractEntityEvent::__construct
File
- modules/
core_event_dispatcher/ src/ Event/ Entity/ EntityViewEvent.php, line 48
Class
- EntityViewEvent
- Class EntityViewEvent.
Namespace
Drupal\core_event_dispatcher\Event\EntityCode
public function __construct(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, string $viewMode) {
parent::__construct($entity);
$this->build =& $build;
$this->display = $display;
$this->viewMode = $viewMode;
}