PreUpdateEventArgs
extends LifecycleEventArgs
in package
Class that holds event arguments for a preUpdate event.
Table of Contents
Properties
- $_emptyEventArgsInstance : EventArgs|null
- Single instance of EventArgs.
- $entityChangeSet : array<string, array{: mixed, : mixed}|PersistentCollection>
- $object : object
- $objectManager : ObjectManager
Methods
- __construct() : mixed
- getEmptyInstance() : EventArgs
- Gets the single, empty and immutable EventArgs instance.
- getEntity() : object
- Retrieves associated Entity.
- getEntityChangeSet() : array<string|int, array<string|int, mixed>>
- Retrieves entity changeset.
- getEntityManager() : EntityManagerInterface
- Retrieves associated EntityManager.
- getNewValue() : mixed
- Gets the new value of the changeset of the changed field.
- getObject() : object
- Retrieves the associated object.
- getObjectManager() : ObjectManager
- Retrieves the associated ObjectManager.
- getOldValue() : mixed
- Gets the old value of the changeset of the changed field.
- hasChangedField() : bool
- Checks if field has a changeset.
- setNewValue() : void
- Sets the new value of this field.
- assertValidField() : void
- Asserts the field exists in changeset.
Properties
$_emptyEventArgsInstance
Single instance of EventArgs.
private
static EventArgs|null
$_emptyEventArgsInstance
$entityChangeSet
private
array<string, array{: mixed, : mixed}|PersistentCollection>
$entityChangeSet
$object
private
object
$object
$objectManager
private
ObjectManager
$objectManager
Tags
Methods
__construct()
public
__construct(object $entity, EntityManagerInterface $em, array<string|int, array<string|int, mixed>> &$changeSet) : mixed
Parameters
- $entity : object
- $em : EntityManagerInterface
- $changeSet : array<string|int, array<string|int, mixed>>
Tags
getEmptyInstance()
Gets the single, empty and immutable EventArgs instance.
public
static getEmptyInstance() : EventArgs
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).
Tags
Return values
EventArgsgetEntity()
Retrieves associated Entity.
public
getEntity() : object
Tags
Return values
objectgetEntityChangeSet()
Retrieves entity changeset.
public
getEntityChangeSet() : array<string|int, array<string|int, mixed>>
Tags
Return values
array<string|int, array<string|int, mixed>>getEntityManager()
Retrieves associated EntityManager.
public
getEntityManager() : EntityManagerInterface
Tags
Return values
EntityManagerInterfacegetNewValue()
Gets the new value of the changeset of the changed field.
public
getNewValue(string $field) : mixed
Parameters
- $field : string
getObject()
Retrieves the associated object.
public
getObject() : object
Return values
objectgetObjectManager()
Retrieves the associated ObjectManager.
public
getObjectManager() : ObjectManager
Tags
Return values
ObjectManagergetOldValue()
Gets the old value of the changeset of the changed field.
public
getOldValue(string $field) : mixed
Parameters
- $field : string
hasChangedField()
Checks if field has a changeset.
public
hasChangedField(string $field) : bool
Parameters
- $field : string
Return values
boolsetNewValue()
Sets the new value of this field.
public
setNewValue(string $field, mixed $value) : void
Parameters
- $field : string
- $value : mixed
assertValidField()
Asserts the field exists in changeset.
private
assertValidField(string $field) : void
Parameters
- $field : string