class ListenersInvoker (View source)

A method invoker based on entity lifecycle.

Constants

INVOKE_NONE

INVOKE_LISTENERS

INVOKE_CALLBACKS

INVOKE_MANAGER

Methods

__construct(EntityManagerInterface $em)

Initializes a new ListenersInvoker instance.

integer
getSubscribedSystems(ClassMetadata $metadata, string $eventName)

Get the subscribed event systems

invoke(ClassMetadata $metadata, string $eventName, object $entity, EventArgs $event, integer $invoke)

Dispatches the lifecycle event of the given entity.

Details

__construct(EntityManagerInterface $em)

Initializes a new ListenersInvoker instance.

Parameters

EntityManagerInterface $em

integer getSubscribedSystems(ClassMetadata $metadata, string $eventName)

Get the subscribed event systems

Parameters

ClassMetadata $metadata The entity metadata.
string $eventName The entity lifecycle event.

Return Value

integer Bitmask of subscribed event systems.

invoke(ClassMetadata $metadata, string $eventName, object $entity, EventArgs $event, integer $invoke)

Dispatches the lifecycle event of the given entity.

Parameters

ClassMetadata $metadata The entity metadata.
string $eventName The entity lifecycle event.
object $entity The Entity on which the event occurred.
EventArgs $event The Event args.
integer $invoke Bitmask to invoke listeners.