Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/EntityTypeEvent.php \Drupal\Core\Entity\EntityTypeEvent
  2. 9 core/lib/Drupal/Core/Entity/EntityTypeEvent.php \Drupal\Core\Entity\EntityTypeEvent

Defines a base class for all entity type events.

Hierarchy

  • class \Drupal\Component\EventDispatcher\Event extends \Symfony\Contracts\EventDispatcher\Event

Expanded class hierarchy of EntityTypeEvent

1 file declares its use of EntityTypeEvent
ViewsEntitySchemaSubscriberIntegrationTest.php in core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php

File

core/lib/Drupal/Core/Entity/EntityTypeEvent.php, line 10

Namespace

Drupal\Core\Entity
View source
class EntityTypeEvent extends Event {

  /**
   * The entity type.
   *
   * @var \Drupal\Core\Entity\EntityTypeInterface
   */
  protected $entityType;

  /**
   * The original entity type.
   *
   * @var \Drupal\Core\Entity\EntityTypeInterface
   */
  protected $original;

  /**
   * Constructs a new EntityTypeEvent.
   *
   * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
   *   The field storage definition.
   * @param \Drupal\Core\Entity\EntityTypeInterface $original
   *   (optional) The original entity type. This should be passed only when
   *   updating the entity type.
   */
  public function __construct(EntityTypeInterface $entity_type, EntityTypeInterface $original = NULL) {
    $this->entityType = $entity_type;
    $this->original = $original;
  }

  /**
   * The entity type the event refers to.
   *
   * @return \Drupal\Core\Entity\EntityTypeInterface
   */
  public function getEntityType() {
    return $this->entityType;
  }

  /**
   * The original entity type.
   *
   * @return \Drupal\Core\Entity\EntityTypeInterface
   */
  public function getOriginal() {
    return $this->original;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityTypeEvent::$entityType protected property The entity type.
EntityTypeEvent::$original protected property The original entity type.
EntityTypeEvent::getEntityType public function The entity type the event refers to.
EntityTypeEvent::getOriginal public function The original entity type.
EntityTypeEvent::__construct public function Constructs a new EntityTypeEvent.