You are here

class EntityCloneEvent in Entity Clone 8

Represents entity selection as event.

Hierarchy

  • class \Drupal\entity_clone\Event\EntityCloneEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of EntityCloneEvent

1 file declares its use of EntityCloneEvent
EntityCloneForm.php in src/Form/EntityCloneForm.php

File

src/Event/EntityCloneEvent.php, line 11

Namespace

Drupal\entity_clone\Event
View source
class EntityCloneEvent extends Event {

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

  /**
   * New cloned entity.
   *
   * @var \Drupal\Core\Entity\EntityInterface
   */
  protected $clonedEntity;

  /**
   * Properties.
   *
   * @var array
   */
  protected $properties;

  /**
   * Constructs an EntityCloneEvent object.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The original entity that was cloned.
   * @param \Drupal\Core\Entity\EntityInterface $cloned_entity
   *   The clone of the original entity.
   * @param array $properties
   *   The entity's properties.
   */
  public function __construct(EntityInterface $entity, EntityInterface $cloned_entity, array $properties = []) {
    $this->entity = $entity;
    $this->clonedEntity = $cloned_entity;
    $this->properties = $properties;
  }

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

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

  /**
   * Gets entity properties.
   *
   * @return array
   *   The list of properties.
   */
  public function getProperties() {
    return $this->properties;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityCloneEvent::$clonedEntity protected property New cloned entity.
EntityCloneEvent::$entity protected property Entity being cloned.
EntityCloneEvent::$properties protected property Properties.
EntityCloneEvent::getClonedEntity public function Gets new cloned entity.
EntityCloneEvent::getEntity public function Gets entity being cloned.
EntityCloneEvent::getProperties public function Gets entity properties.
EntityCloneEvent::__construct public function Constructs an EntityCloneEvent object.