class PreUpdateEventArgs extends LifecycleEventArgs (View source)

Class that holds event arguments for a preUpdate event.

Methods

static EventArgs
getEmptyInstance()

Gets the single, empty and immutable EventArgs instance.

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

Constructor.

object
getEntity()

Retrieve associated Entity.

getObjectManager()

Retrieve associated ObjectManager.

array
getEntityChangeSet()

Retrieve entity changeset.

boolean
hasChangedField(string $field)

Check if field has a changeset.

mixed
getOldValue(string $field)

Get the old value of the changeset of the changed field.

mixed
getNewValue(string $field)

Get the new value of the changeset of the changed field.

setNewValue(string $field, mixed $value)

Set the new value of this field.

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, array $changeSet)

Constructor.

Parameters

object $entity
ObjectManager $objectManager
array $changeSet

object getEntity()

Retrieve associated Entity.

Return Value

object

ObjectManager getObjectManager()

Retrieve associated ObjectManager.

Return Value

ObjectManager

array getEntityChangeSet()

Retrieve entity changeset.

Return Value

array

boolean hasChangedField(string $field)

Check if field has a changeset.

Parameters

string $field

Return Value

boolean

mixed getOldValue(string $field)

Get the old value of the changeset of the changed field.

Parameters

string $field

Return Value

mixed

mixed getNewValue(string $field)

Get the new value of the changeset of the changed field.

Parameters

string $field

Return Value

mixed

setNewValue(string $field, mixed $value)

Set the new value of this field.

Parameters

string $field
mixed $value