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.

int
getSubscribedSystems(ClassMetadata $metadata, string $eventName)

Get the subscribed event systems

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

Dispatches the lifecycle event of the given entity.

Details

__construct(EntityManagerInterface $em)

Initializes a new ListenersInvoker instance.

Parameters

EntityManagerInterface $em

int getSubscribedSystems(ClassMetadata $metadata, string $eventName)

Get the subscribed event systems

Parameters

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

Return Value

int Bitmask of subscribed event systems.

invoke(ClassMetadata $metadata, string $eventName, object $entity, EventArgs $event, int $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.
int $invoke Bitmask to invoke listeners.