You are here

class EntityDuplicateEvent in Entity API 8

Defines the entity duplicate event.

Hierarchy

Expanded class hierarchy of EntityDuplicateEvent

See also

\Drupal\entity\Event\EntityEvents

2 files declare their use of EntityDuplicateEvent
EntityDuplicateFormTrait.php in src/Form/EntityDuplicateFormTrait.php
EntityDuplicateSubscriber.php in src/EventSubscriber/EntityDuplicateSubscriber.php

File

src/Event/EntityDuplicateEvent.php, line 13

Namespace

Drupal\entity\Event
View source
class EntityDuplicateEvent extends Event {

  /**
   * The entity.
   *
   * @var \Drupal\Core\Entity\EntityInterface
   */
  protected $entity;

  /**
   * The source entity.
   *
   * @var \Drupal\Core\Entity\EntityInterface
   */
  protected $sourceEntity;

  /**
   * Constructs a new EntityDuplicateEvent object.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity.
   * @param \Drupal\Core\Entity\EntityInterface $source_entity
   *   The source entity.
   */
  public function __construct(EntityInterface $entity, EntityInterface $source_entity) {
    $this->entity = $entity;
    $this->sourceEntity = $source_entity;
  }

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

  /**
   * Gets the source entity.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   The source entity.
   */
  public function getSourceEntity() {
    return $this->sourceEntity;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityDuplicateEvent::$entity protected property The entity.
EntityDuplicateEvent::$sourceEntity protected property The source entity.
EntityDuplicateEvent::getEntity public function Gets the entity.
EntityDuplicateEvent::getSourceEntity public function Gets the source entity.
EntityDuplicateEvent::__construct public function Constructs a new EntityDuplicateEvent object.