class DataImportEvent in YAML Content 8
Same name and namespace in other branches
- 8.2 src/Event/DataImportEvent.php \Drupal\yaml_content\Event\DataImportEvent
Wraps a yaml content data import event for event listeners.
Hierarchy
- class \Drupal\yaml_content\Event\EventBase extends \Symfony\Component\EventDispatcher\Event
- class \Drupal\yaml_content\Event\DataImportEvent
Expanded class hierarchy of DataImportEvent
File
- src/
Event/ DataImportEvent.php, line 10
Namespace
Drupal\yaml_content\EventView source
class DataImportEvent extends EventBase {
/**
* The parsed content from the file used to create the entity.
*
* @var array
*/
protected $contentData;
/**
* Constructs a yaml content entity pre-save event object.
*
* @param \Drupal\yaml_content\ContentLoader\ContentLoaderInterface $loader
* The active Content Loader that triggered the event.
* @param array $content_data
* The parsed content loaded from the content file to be loaded into
* the entity field.
*/
public function __construct(ContentLoaderInterface $loader, array $content_data) {
parent::__construct($loader);
$this->contentData = $content_data;
}
/**
* Gets the parsed content to populate into the field.
*
* @return array
* The parsed content loaded from the content file to be loaded into
* the entity field.
*/
public function getContentData() {
return $this->contentData;
}
}
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. | |
DataImportEvent:: |
public | function |
Constructs a yaml content entity pre-save event object. Overrides EventBase:: |
2 |
EventBase:: |
protected | property | The ContentLoader being actively executed and triggering the event. | |
EventBase:: |
public | function | Gets the ContentLoader object that triggered the event. |