Hey there, your first insight is right, you're holding 2 references to the same object, so it'll always be the same. In your second case I could only imagine that the updated_at field is being updated (maybe). To find out, why don't you look at the serialized strings and see where they differ...
Another way of detecting updates is testing if updated_at == time(), because (at least in propel), it should only be updated when the object is actually saved. Daniel On Nov 12, 7:03 am, LeBurt <burt.crepea...@gmail.com> wrote: > Thanks for the suggestion Gareth. Unfortunately it doesn't work. > > Since I'm not all that knowledgeable in OOP, I was thinking this might > have something to do with the $oldstate and $newstate objects being > the same (two references to the same object), that way when you change > one the other changes also. To rule that out I tried this, based on > your suggestion: > > $state = Doctrine::getTable('myClass')->find($id); > $oldstate = serialize($state); > $form->save(); > $state = Doctrine::getTable('myClass')->find($id); > $newstate = serialize($state); > if ($oldstate != $newstate) return 'changes'; > else return 'nochanges'; > > Don't laugh, that's how I learn... ;) > > In any case, no joy, but the behaviour is opposite as before: I always > get changes! > > Puzzling... -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en