You are here

public function EntityBuildDefaultsAlterEvent::__construct in Hook Event Dispatcher 8

EntityBuildDefaultsAlterEvent constructor.

Parameters

array &$build: A renderable array representing the entity content. It will not have other elements aside from the entity and a #cache parameter. The structure of $build is a renderable array as expected by drupal_render().

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

string $viewMode: The view mode the entity is rendered in.

Overrides BaseEntityEvent::__construct

File

src/Event/Entity/EntityBuildDefaultsAlterEvent.php, line 39

Class

EntityBuildDefaultsAlterEvent
Class EntityBuildDefaultsAlterEvent.

Namespace

Drupal\hook_event_dispatcher\Event\Entity

Code

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