Repository URL to install this package:
|
Version:
3.0.0 ▾
|
<?php
namespace Drupal\trio_touchpoint\Event;
use Drupal\Component\EventDispatcher\Event;
use Drupal\Core\Entity\EntityInterface;
/**
* Class to contain an entity event.
*/
class EntityEvent extends Event {
/**
* The Entity.
*
* @var \Drupal\Core\Entity\EntityInterface
*/
private $entity;
/**
* The event type.
*
* @var BpEntityEventType
*/
private $eventType;
/**
* Construct a new entity event.
*
* @param string $event_type
* The event type.
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity which caused the event.
*/
public function __construct(string $event_type, EntityInterface $entity) {
$this->entity = $entity;
$this->eventType = $event_type;
}
/**
* Method to get the entity from the event.
*/
public function getEntity() {
return $this->entity;
}
/**
* Method to get the event type.
*/
public function getEventType() {
return $this->eventType;
}
}