class EntityImportEvent in Acquia Content Hub 8.2
An event for invoking post-entity-save operations.
This event has no setters because it is purely informational. It informs subscribers of an event and invites them to perform related actions but not to modify any variables relevant to the event itself.
Hierarchy
- class \Drupal\acquia_contenthub\Event\EntityImportEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of EntityImportEvent
5 files declare their use of EntityImportEvent
- ContentLanguageSettings.php in src/
EventSubscriber/ EntityImport/ ContentLanguageSettings.php - EntityCdfSerializer.php in src/
EntityCdfSerializer.php - FilterFormatEditor.php in src/
EventSubscriber/ EntityImport/ FilterFormatEditor.php - ImportUserData.php in src/
EventSubscriber/ EntityImport/ ImportUserData.php - TrackEntity.php in modules/
acquia_contenthub_subscriber/ src/ EventSubscriber/ EntityImport/ TrackEntity.php
File
- src/
Event/ EntityImportEvent.php, line 16
Namespace
Drupal\acquia_contenthub\EventView source
class EntityImportEvent extends Event {
/**
* The entity that was imported.
*
* @var \Drupal\Core\Entity\EntityInterface
*/
protected $entity;
/**
* The source array data that was used to create the entity.
*
* This is useful for situations where you might want to refer to the data
* as it existed before an entity was created.
*
* @var \Acquia\ContentHubClient\CDF\CDFObject
*/
protected $entityData;
/**
* EntityImportEvent constructor.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity tht was saved.
* @param \Acquia\ContentHubClient\CDF\CDFObject $entity_data
* The CDF level data from which we saved the entity.
*/
public function __construct(EntityInterface $entity, CDFObject $entity_data) {
$this->entity = $entity;
$this->entityData = $entity_data;
}
/**
* Get the entity that was imported.
*
* @return \Drupal\Core\Entity\EntityInterface
* The entity.
*/
public function getEntity() {
return $this->entity;
}
/**
* Get the entity data that was used to create the entity.
*
* @return \Acquia\ContentHubClient\CDF\CDFObject
* The CDF object.
*/
public function getEntityData() {
return $this->entityData;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityImportEvent:: |
protected | property | The entity that was imported. | |
EntityImportEvent:: |
protected | property | The source array data that was used to create the entity. | |
EntityImportEvent:: |
public | function | Get the entity that was imported. | |
EntityImportEvent:: |
public | function | Get the entity data that was used to create the entity. | |
EntityImportEvent:: |
public | function | EntityImportEvent constructor. |