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() deprecated

Retrieves the associated entity.

object
getObject()

Retrieves the associated object.

getObjectManager()

Retrieves the associated ObjectManager.

array
getEntityChangeSet()

Retrieves the entity changeset.

boolean
hasChangedField(string $field)

Checks if field has a changeset.

mixed
getOldValue(string $field)

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

mixed
getNewValue(string $field)

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

void
setNewValue(string $field, mixed $value)

Sets 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() deprecated

deprecated

Retrieves the associated entity.

Return Value

object

object getObject()

Retrieves the associated object.

Return Value

object

ObjectManager getObjectManager()

Retrieves the associated ObjectManager.

Return Value

ObjectManager

array getEntityChangeSet()

Retrieves the entity changeset.

Return Value

array

boolean hasChangedField(string $field)

Checks if field has a changeset.

Parameters

string $field

Return Value

boolean

mixed getOldValue(string $field)

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

Parameters

string $field

Return Value

mixed

mixed getNewValue(string $field)

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

Parameters

string $field

Return Value

mixed

void setNewValue(string $field, mixed $value)

Sets the new value of this field.

Parameters

string $field
mixed $value

Return Value

void