EntityTypeEventSubscriberTrait::onEntityTypeEvent

public EntityTypeEventSubscriberTrait::onEntityTypeEvent(EntityTypeEvent $event, $event_name)

Listener method for any entity type definition event.

Parameters

\Drupal\Core\Entity\EntityTypeEvent $event: The field storage definition event object.

string $event_name: The event name.

File

core/lib/Drupal/Core/Entity/EntityTypeEventSubscriberTrait.php, line 40

Class

EntityTypeEventSubscriberTrait
Helper methods for EntityTypeListenerInterface.

Namespace

Drupal\Core\Entity

Code

public function onEntityTypeEvent(EntityTypeEvent $event, $event_name) {
  switch ($event_name) {
    case EntityTypeEvents::CREATE:
      $this->onEntityTypeCreate($event->getEntityType());
      break;

    case EntityTypeEvents::UPDATE:
      $this->onEntityTypeUpdate($event->getEntityType(), $event->getOriginal());
      break;

    case EntityTypeEvents::DELETE:
      $this->onEntityTypeDelete($event->getEntityType());
      break;
  }
}
doc_Drupal
2016-10-29 09:08:14
Comments
Leave a Comment

Please login to continue.