trait EntityTypeEventSubscriberTrait (View source)

Helper methods for EntityTypeListenerInterface.

This allows a class implementing EntityTypeListenerInterface to subscribe and react to entity type events.

Methods

static array
getEntityTypeEvents()

Gets the subscribed events.

onEntityTypeEvent(EntityTypeEvent $event, string $event_name)

Listener method for any entity type definition event.

onEntityTypeCreate(EntityTypeInterface $entity_type)

{@inheritdoc}

onFieldableEntityTypeCreate(EntityTypeInterface $entity_type, array $field_storage_definitions)

{@inheritdoc}

onEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original)

{@inheritdoc}

onFieldableEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original, array $field_storage_definitions, array $original_field_storage_definitions, array $sandbox = NULL)

{@inheritdoc}

onEntityTypeDelete(EntityTypeInterface $entity_type)

{@inheritdoc}

Details

static array getEntityTypeEvents()

Gets the subscribed events.

Return Value

array

An array of subscribed event names.

See also

\Symfony\Component\EventDispatcher\EventSubscriberInterface::getSubscribedEvents()

onEntityTypeEvent(EntityTypeEvent $event, string $event_name)

Listener method for any entity type definition event.

Parameters

EntityTypeEvent $event

The field storage definition event object.

string $event_name

The event name.

onEntityTypeCreate(EntityTypeInterface $entity_type)

{@inheritdoc}

Parameters

EntityTypeInterface $entity_type

onFieldableEntityTypeCreate(EntityTypeInterface $entity_type, array $field_storage_definitions)

{@inheritdoc}

Parameters

EntityTypeInterface $entity_type
array $field_storage_definitions

onEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original)

{@inheritdoc}

Parameters

EntityTypeInterface $entity_type
EntityTypeInterface $original

onFieldableEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original, array $field_storage_definitions, array $original_field_storage_definitions, array $sandbox = NULL)

{@inheritdoc}

Parameters

EntityTypeInterface $entity_type
EntityTypeInterface $original
array $field_storage_definitions
array $original_field_storage_definitions
array $sandbox

onEntityTypeDelete(EntityTypeInterface $entity_type)

{@inheritdoc}

Parameters

EntityTypeInterface $entity_type