class OnClearEventArgs extends EventArgs (View source)

Provides event arguments for the onClear event.

Methods

static EventArgs
getEmptyInstance()

Gets the single, empty and immutable EventArgs instance.

from EventArgs
__construct(ObjectManager $objectManager, string $entityClass = null)

Constructor.

getObjectManager()

Retrieve associated ObjectManager.

string
getEntityClass()

Name of the entity class that is cleared, or empty if all are cleared.

bool
clearsAllEntities()

Check if event clears all entities.

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(ObjectManager $objectManager, string $entityClass = null)

Constructor.

Parameters

ObjectManager $objectManager
string $entityClass Optional entity class

ObjectManager getObjectManager()

Retrieve associated ObjectManager.

Return Value

ObjectManager

string getEntityClass()

Name of the entity class that is cleared, or empty if all are cleared.

Return Value

string

bool clearsAllEntities()

Check if event clears all entities.

Return Value

bool