From bf235030003ae213af7466845be3e2ac6e0c2e72 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 29 Jul 2010 18:41:16 +0800 Subject: [PATCH 1/2] Missing field name? --- manual/en/events.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'); } } From fcea78a6cb705695cacf8f38a12f30eacca195c0 Mon Sep 17 00:00:00 2001 From: "Roman S. Borschel" Date: Sat, 31 Jul 2010 12:00:34 +0200 Subject: [PATCH 2/2] Updated merging docs. --- manual/en/working-with-objects.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manual/en/working-with-objects.txt b/manual/en/working-with-objects.txt index fbfc45f20..9b10a3377 100644 --- a/manual/en/working-with-objects.txt +++ b/manual/en/working-with-objects.txt @@ -159,8 +159,8 @@ Example: The semantics of the merge operation, applied to an entity X, are as follows: -* If X is a detached entity, the state of X is copied onto a pre-existing managed entity instance X' of the same identity or a new managed copy X' of X is created. -* If X is a new entity instance, an InvalidArgumentException will be thrown. +* If X is a detached entity, the state of X is copied onto a pre-existing managed entity instance X' of the same identity. +* If X is a new entity instance, a new managed copy X' will be created and the state of X is copied onto this managed instance. * If X is a removed entity instance, an InvalidArgumentException will be thrown. * If X is a managed entity, it is ignored by the merge operation, however, the merge operation is cascaded to entities referenced by relationships from X if these relationships have been mapped with the cascade element value MERGE or ALL (see "Transitive Persistence"). * For all entities Y referenced by relationships from X having the cascade element value