class FieldImportEvent in YAML Content 8
Same name and namespace in other branches
- 8.2 src/Event/FieldImportEvent.php \Drupal\yaml_content\Event\FieldImportEvent
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\FieldImportEvent
- class \Drupal\yaml_content\Event\DataImportEvent
Expanded class hierarchy of FieldImportEvent
1 file declares its use of FieldImportEvent
- ContentLoader.php in src/
ContentLoader/ ContentLoader.php
File
- src/
Event/ FieldImportEvent.php, line 12
Namespace
Drupal\yaml_content\EventView source
class FieldImportEvent extends DataImportEvent {
/**
* The entity being populated with field data.
*
* @var \Drupal\Core\Entity\EntityInterface
*/
protected $entity;
/**
* The field object being populated.
*
* @var \Drupal\Core\Field\FieldItemListInterface
*/
protected $field;
/**
* Constructs a yaml content field import 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 being populated with field data.
* @param \Drupal\Core\Field\FieldItemListInterface $field
* The field object 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, EntityInterface $entity, FieldItemListInterface $field, array $content_data) {
parent::__construct($loader, $content_data);
$this->entity = $entity;
$this->field = $field;
}
/**
* Gets the entity being populated with field data.
*
* @return \Drupal\Core\Entity\EntityInterface
* The entity being populated with field data.
*/
public function getEntity() {
return $this->entity;
}
/**
* Gets the field object being populated.
*
* @return \Drupal\Core\Field\FieldItemListInterface
* The field object being populated.
*/
public function getField() {
return $this->field;
}
}
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. | |
EventBase:: |
protected | property | The ContentLoader being actively executed and triggering the event. | |
EventBase:: |
public | function | Gets the ContentLoader object that triggered the event. | |
FieldImportEvent:: |
protected | property | The entity being populated with field data. | |
FieldImportEvent:: |
protected | property | The field object being populated. | |
FieldImportEvent:: |
public | function | Gets the entity being populated with field data. | |
FieldImportEvent:: |
public | function | Gets the field object being populated. | |
FieldImportEvent:: |
public | function |
Constructs a yaml content field import event object. Overrides DataImportEvent:: |