class EntityPostSaveEvent in YAML Content 8
Same name and namespace in other branches
- 8.2 src/Event/EntityPostSaveEvent.php \Drupal\yaml_content\Event\EntityPostSaveEvent
Wraps a yaml content entity post-save event for event listeners.
Hierarchy
- class \Drupal\yaml_content\Event\EventBase extends \Symfony\Component\EventDispatcher\Event
- class \Drupal\yaml_content\Event\EntityPostSaveEvent
Expanded class hierarchy of EntityPostSaveEvent
1 file declares its use of EntityPostSaveEvent
- ContentLoader.php in src/
ContentLoader/ ContentLoader.php
File
- src/
Event/ EntityPostSaveEvent.php, line 11
Namespace
Drupal\yaml_content\EventView source
class EntityPostSaveEvent extends EventBase {
/**
* The imported and saved entity object.
*
* @var \Drupal\Core\Entity\EntityInterface
*/
protected $entity;
/**
* The parsed content from the file used to create the entity.
*
* @var array
*/
protected $contentData;
/**
* Constructs a yaml content entity post-save event object.
*
* @param \Drupal\yaml_content\ContentLoader\ContentLoaderInterface $loader
* The active Content Loader that triggered the event.
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity loaded with content and saved.
* @param array $content_data
* The parsed content loaded from the content file resulting in this entity.
*/
public function __construct(ContentLoaderInterface $loader, EntityInterface $entity, array $content_data) {
parent::__construct($loader);
$this->entity = $entity;
$this->contentData = $content_data;
}
/**
* Gets the entity that was imported and saved.
*
* @return \Drupal\Core\Entity\EntityInterface
* The saved entity object.
*/
public function getEntity() {
return $this->entity;
}
/**
* Gets the parsed content loaded from the content file to create the entity.
*
* @return array
* The parsed content from the file used to create the entity.
*/
public function getContentData() {
return $this->contentData;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityPostSaveEvent:: |
protected | property | The parsed content from the file used to create the entity. | |
EntityPostSaveEvent:: |
protected | property | The imported and saved entity object. | |
EntityPostSaveEvent:: |
public | function | Gets the parsed content loaded from the content file to create the entity. | |
EntityPostSaveEvent:: |
public | function | Gets the entity that was imported and saved. | |
EntityPostSaveEvent:: |
public | function |
Constructs a yaml content entity post-save event object. Overrides EventBase:: |
|
EventBase:: |
protected | property | The ContentLoader being actively executed and triggering the event. | |
EventBase:: |
public | function | Gets the ContentLoader object that triggered the event. |