class AttachEntityListenersListener (View source)

Mechanism to programmatically attach entity listeners.

Methods

addEntityListener(string $entityClass, string $listenerClass, string $eventName, string|null $listenerCallback = null)

Adds a entity listener for a specific entity.

loadClassMetadata(LoadClassMetadataEventArgs $event)

Processes event and attach the entity listener.

Details

addEntityListener(string $entityClass, string $listenerClass, string $eventName, string|null $listenerCallback = null)

Adds a entity listener for a specific entity.

Parameters

string $entityClass The entity to attach the listener.
string $listenerClass The listener class.
string $eventName The entity lifecycle event.
string|null $listenerCallback The listener callback method or NULL to use $eventName.

loadClassMetadata(LoadClassMetadataEventArgs $event)

Processes event and attach the entity listener.

Parameters

LoadClassMetadataEventArgs $event