class EntityDuplicateEvent in Entity API 8
Defines the entity duplicate event.
Hierarchy
- class \Drupal\entity\Event\EntityDuplicateEvent extends \Symfony\Component\EventDispatcher\Event
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\EventView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityDuplicateEvent:: |
protected | property | The entity. | |
EntityDuplicateEvent:: |
protected | property | The source entity. | |
EntityDuplicateEvent:: |
public | function | Gets the entity. | |
EntityDuplicateEvent:: |
public | function | Gets the source entity. | |
EntityDuplicateEvent:: |
public | function | Constructs a new EntityDuplicateEvent object. |