class LifecycleEventArgs extends EventArgs (View source)

Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions of entities.

Methods

static EventArgs
getEmptyInstance()

Gets the single, empty and immutable EventArgs instance.

from EventArgs
__construct(object $entity, ObjectManager $objectManager)

Constructor

object
getEntity()

Retrieve associated Entity.

getObjectManager()

Retrieve associated ObjectManager.

Details

static EventArgs getEmptyInstance()

Gets the single, empty and immutable EventArgs instance.

This instance will be used when events are dispatched without any parameter, like this: EventManager::dispatchEvent('eventname');

The benefit from this is that only one empty instance is instantiated and shared (otherwise there would be instances for every dispatched in the abovementioned form)

Return Value

EventArgs

See also

EventManager::dispatchEvent

__construct(object $entity, ObjectManager $objectManager)

Constructor

Parameters

object $entity
ObjectManager $objectManager

object getEntity()

Retrieve associated Entity.

Return Value

object

ObjectManager getObjectManager()

Retrieve associated ObjectManager.

Return Value

ObjectManager