class SerializeAdditionalMetadataEvent in Acquia Content Hub 8.2
The event dispatched to serialize additional metadata for a Content Entity.
This event allows to attach additional metadata for a content entity which is not handled by fields. E.g. Webform Elements.
Hierarchy
- class \Drupal\acquia_contenthub\Event\SerializeAdditionalMetadataEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of SerializeAdditionalMetadataEvent
2 files declare their use of SerializeAdditionalMetadataEvent
- ContentEntityHandler.php in src/
EventSubscriber/ Cdf/ ContentEntityHandler.php - WebformSubmissionHandler.php in src/
EventSubscriber/ Cdf/ WebformSubmissionHandler.php
File
- src/
Event/ SerializeAdditionalMetadataEvent.php, line 15
Namespace
Drupal\acquia_contenthub\EventView source
class SerializeAdditionalMetadataEvent extends Event {
/**
* The entity being serialized.
*
* @var \Drupal\Core\Entity\ContentEntityInterface
*/
protected $entity;
/**
* The CDF Object generated for this entity.
*
* @var \Acquia\ContentHubClient\CDF\CDFObject
*/
protected $cdf;
/**
* CreateCdfEntityEvent constructor.
*
* @param \Drupal\Core\Entity\ContentEntityInterface $entity
* The entity being serialized.
* @param \Acquia\ContentHubClient\CDF\CDFObject $cdf
* The CDF object generated for this entity.
*/
public function __construct(ContentEntityInterface $entity, CDFObject $cdf) {
$this->entity = $entity;
$this->cdf = $cdf;
}
/**
* Returns content entity event holds.
*
* @return \Drupal\Core\Entity\ContentEntityInterface
* Current entity event holds.
*/
public function getEntity() : ContentEntityInterface {
return $this->entity;
}
/**
* Get the current CDF object event holds.
*
* @return \Acquia\ContentHubClient\CDF\CDFObject
* The CDF object.
*/
public function getCdf() : CDFObject {
return $this->cdf;
}
/**
* Set the CDF object event holds.
*
* @param \Acquia\ContentHubClient\CDF\CDFObject $cdf
* The CDF Object.
*/
public function setCdf(CDFObject $cdf) {
$this->cdf = $cdf;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SerializeAdditionalMetadataEvent:: |
protected | property | The CDF Object generated for this entity. | |
SerializeAdditionalMetadataEvent:: |
protected | property | The entity being serialized. | |
SerializeAdditionalMetadataEvent:: |
public | function | Get the current CDF object event holds. | |
SerializeAdditionalMetadataEvent:: |
public | function | Returns content entity event holds. | |
SerializeAdditionalMetadataEvent:: |
public | function | Set the CDF object event holds. | |
SerializeAdditionalMetadataEvent:: |
public | function | CreateCdfEntityEvent constructor. |