You are here

public function EntityPreSaveEvent::__construct in YAML Content 8.2

Same name and namespace in other branches
  1. 8 src/Event/EntityPreSaveEvent.php \Drupal\yaml_content\Event\EntityPreSaveEvent::__construct()

Constructs a yaml content entity pre-save event object.

Parameters

\Drupal\yaml_content\ContentLoader\ContentLoaderInterface $loader: The active Content Loader that triggered the event.

\Drupal\Core\Entity\EntityInterface $entity: The entity loaded with content and prepared for saving.

array $content_data: The parsed content loaded from the content file resulting in this entity.

Overrides EventBase::__construct

File

src/Event/EntityPreSaveEvent.php, line 37

Class

EntityPreSaveEvent
Wraps a yaml content entity pre-save event for event listeners.

Namespace

Drupal\yaml_content\Event

Code

public function __construct(ContentLoaderInterface $loader, EntityInterface $entity, array $content_data) {
  parent::__construct($loader);
  $this->entity = $entity;
  $this->contentData = $content_data;
}