You are here

class UnserializeAdditionalMetadataEvent in Acquia Content Hub 8.2

The event dispatched to unserialize additional metadata for a Content Entity.

This event allows to unserialize additional attached metadata for a content entity which is not handled by fields. E.g. Webform Elements.

Hierarchy

Expanded class hierarchy of UnserializeAdditionalMetadataEvent

2 files declare their use of UnserializeAdditionalMetadataEvent
ContentEntityHandler.php in src/EventSubscriber/Cdf/ContentEntityHandler.php
WebformSubmissionHandler.php in src/EventSubscriber/Cdf/WebformSubmissionHandler.php

File

src/Event/UnserializeAdditionalMetadataEvent.php, line 16

Namespace

Drupal\acquia_contenthub\Event
View source
class UnserializeAdditionalMetadataEvent 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;
  }

  /**
   * 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;
  }

  /**
   * Returns entity, event currently holds.
   *
   * @return \Drupal\Core\Entity\ContentEntityInterface
   *   Content Entity object.
   */
  public function getEntity() : ContentEntityInterface {
    return $this->entity;
  }

  /**
   * Sets the current entity event holds.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
   *   Content entity object.
   */
  public function setEntity(ContentEntityInterface $entity) {
    $this->entity = $entity;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
UnserializeAdditionalMetadataEvent::$cdf protected property The CDF Object generated for this entity.
UnserializeAdditionalMetadataEvent::$entity protected property The entity being serialized.
UnserializeAdditionalMetadataEvent::getCdf public function Get the current CDF object event holds.
UnserializeAdditionalMetadataEvent::getEntity public function Returns entity, event currently holds.
UnserializeAdditionalMetadataEvent::setCdf public function Set the CDF object event holds.
UnserializeAdditionalMetadataEvent::setEntity public function Sets the current entity event holds.
UnserializeAdditionalMetadataEvent::__construct public function CreateCdfEntityEvent constructor.