1
0
mirror of synced 2024-12-15 15:46:02 +03:00

Missing field name?

This commit is contained in:
Your Name 2010-07-29 18:41:16 +08:00 committed by Benjamin Eberlei
parent 84c1cc8865
commit bf23503000

View File

@ -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');
} }
} }