3 namespace Drupal\Core\Entity;
5 use Symfony\Component\EventDispatcher\GenericEvent;
8 * Defines a base class for all entity type events.
10 class EntityTypeEvent extends GenericEvent {
15 * @var \Drupal\Core\Entity\EntityTypeInterface
17 protected $entityType;
20 * The original entity type.
22 * @var \Drupal\Core\Entity\EntityTypeInterface
27 * Constructs a new EntityTypeEvent.
29 * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
30 * The field storage definition.
31 * @param \Drupal\Core\Entity\EntityTypeInterface $original
32 * (optional) The original entity type. This should be passed only when
33 * updating the entity type.
35 public function __construct(EntityTypeInterface $entity_type, EntityTypeInterface $original = NULL) {
36 $this->entityType = $entity_type;
37 $this->original = $original;
41 * The entity type the event refers to.
43 * @return \Drupal\Core\Entity\EntityTypeInterface
45 public function getEntityType() {
46 return $this->entityType;
50 * The original entity type.
52 * @return \Drupal\Core\Entity\EntityTypeInterface
54 public function getOriginal() {
55 return $this->original;