diff --git a/manual/en/events.txt b/manual/en/events.txt index 951ed153d..f08bac819 100644 --- a/manual/en/events.txt +++ b/manual/en/events.txt @@ -387,7 +387,7 @@ A simple example for this event looks like: public function preUpdate(PreUpdateEventArgs $eventArgs) { if ($eventArgs->getEntity() instanceof User) { - if ($eventArgs->hasChangedField('name') && $eventArgs->getNewValue() == 'Alice') { + if ($eventArgs->hasChangedField('name') && $eventArgs->getNewValue('name') == 'Alice') { $eventArgs->setNewValue('name', 'Bob'); } }