You are here

class CdfAttributesEvent in Acquia Content Hub 8.2

The event which adds custom CDF attributes to the CDF objects.

Hierarchy

  • class \Drupal\acquia_contenthub\Event\CdfAttributesEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of CdfAttributesEvent

14 files declare their use of CdfAttributesEvent
BaseUrlAttribute.php in src/EventSubscriber/CdfAttributes/BaseUrlAttribute.php
CdfVersionAttribute.php in src/EventSubscriber/CdfAttributes/CdfVersionAttribute.php
EntityCdfSerializer.php in src/EntityCdfSerializer.php
EntityChannelsAttribute.php in src/EventSubscriber/CdfAttributes/EntityChannelsAttribute.php
EntityLanguagesAttribute.php in src/EventSubscriber/CdfAttributes/EntityLanguagesAttribute.php

... See full list

File

src/Event/CdfAttributesEvent.php, line 13

Namespace

Drupal\acquia_contenthub\Event
View source
class CdfAttributesEvent extends Event {

  /**
   * The CDF Object for which to create attributes.
   *
   * @var \Acquia\ContentHubClient\CDF\CDFObject
   */
  protected $cdf;

  /**
   * The entity which corresponds to the CDF object.
   *
   * @var \Drupal\Core\Entity\EntityInterface
   */
  protected $entity;

  /**
   * An entity wrapper class for finding and tracking dependencies of an entity.
   *
   * @var \Drupal\depcalc\DependentEntityWrapperInterface
   */
  protected $wrapper;

  /**
   * CdfAttributesEvent constructor.
   *
   * @param \Acquia\ContentHubClient\CDF\CDFObject $cdf
   *   The CDF object.
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity.
   * @param \Drupal\depcalc\DependentEntityWrapperInterface $wrapper
   *   Dependent entity wrapper.
   */
  public function __construct(CDFObject $cdf, EntityInterface $entity, DependentEntityWrapperInterface $wrapper) {
    $this->cdf = $cdf;
    $this->entity = $entity;
    $this->wrapper = $wrapper;
  }

  /**
   * Get the CDF being created.
   *
   * @return \Acquia\ContentHubClient\CDF\CDFObject
   *   The CDF object.
   */
  public function getCdf() : CDFObject {
    return $this->cdf;
  }

  /**
   * Get the entity being processed.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   The entity being processed.
   */
  public function getEntity() : EntityInterface {
    return $this->entity;
  }

  /**
   * Get the Dependent entity wrapper.
   *
   * @return \Drupal\depcalc\DependentEntityWrapperInterface
   *   Dependent entity wrapper.
   */
  public function getWrapper() : DependentEntityWrapperInterface {
    return $this->wrapper;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CdfAttributesEvent::$cdf protected property The CDF Object for which to create attributes.
CdfAttributesEvent::$entity protected property The entity which corresponds to the CDF object.
CdfAttributesEvent::$wrapper protected property An entity wrapper class for finding and tracking dependencies of an entity.
CdfAttributesEvent::getCdf public function Get the CDF being created.
CdfAttributesEvent::getEntity public function Get the entity being processed.
CdfAttributesEvent::getWrapper public function Get the Dependent entity wrapper.
CdfAttributesEvent::__construct public function CdfAttributesEvent constructor.