Missing field name?
This commit is contained in:
parent
84c1cc8865
commit
bf23503000
@ -387,7 +387,7 @@ A simple example for this event looks like:
|
|||||||
public function preUpdate(PreUpdateEventArgs $eventArgs)
|
public function preUpdate(PreUpdateEventArgs $eventArgs)
|
||||||
{
|
{
|
||||||
if ($eventArgs->getEntity() instanceof User) {
|
if ($eventArgs->getEntity() instanceof User) {
|
||||||
if ($eventArgs->hasChangedField('name') && $eventArgs->getNewValue() == 'Alice') {
|
if ($eventArgs->hasChangedField('name') && $eventArgs->getNewValue('name') == 'Alice') {
|
||||||
$eventArgs->setNewValue('name', 'Bob');
|
$eventArgs->setNewValue('name', 'Bob');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user