class EntityImportEvent in YAML Content 8
Same name and namespace in other branches
- 8.2 src/Event/EntityImportEvent.php \Drupal\yaml_content\Event\EntityImportEvent
Wraps a yaml content field import event for event listeners.
Hierarchy
- class \Drupal\yaml_content\Event\EventBase extends \Symfony\Component\EventDispatcher\Event
- class \Drupal\yaml_content\Event\DataImportEvent
- class \Drupal\yaml_content\Event\EntityImportEvent
- class \Drupal\yaml_content\Event\DataImportEvent
Expanded class hierarchy of EntityImportEvent
1 file declares its use of EntityImportEvent
- ContentLoader.php in src/
ContentLoader/ ContentLoader.php
File
- src/
Event/ EntityImportEvent.php, line 11
Namespace
Drupal\yaml_content\EventView source
class EntityImportEvent extends DataImportEvent {
/**
* The entity type object for the entity being created.
*
* @var \Drupal\Core\Entity\EntityTypeInterface
*/
protected $entityType;
/**
* Constructs a yaml content entity import event object.
*
* @param \Drupal\yaml_content\ContentLoader\ContentLoaderInterface $loader
* The active Content Loader that triggered the event.
* @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
* The field definition for the field being populated.
* @param array $content_data
* The parsed content loaded from the content file to be loaded into
* the entity field.
*/
public function __construct(ContentLoaderInterface $loader, EntityTypeInterface $entity_type, array $content_data) {
parent::__construct($loader, $content_data);
$this->entityType = $entity_type;
}
/**
* Gets the field definition object for the field being populated.
*
* @return \Drupal\Core\Entity\EntityTypeInterface
* The entity type object for the entity being created.
*/
public function getEntityType() {
return $this->entityType;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DataImportEvent:: |
protected | property | The parsed content from the file used to create the entity. | |
DataImportEvent:: |
public | function | Gets the parsed content to populate into the field. | |
EntityImportEvent:: |
protected | property | The entity type object for the entity being created. | |
EntityImportEvent:: |
public | function | Gets the field definition object for the field being populated. | |
EntityImportEvent:: |
public | function |
Constructs a yaml content entity import event object. Overrides DataImportEvent:: |
|
EventBase:: |
protected | property | The ContentLoader being actively executed and triggering the event. | |
EventBase:: |
public | function | Gets the ContentLoader object that triggered the event. |