if (serialize($oldstate) != serialize($newstate)) Once converted to a string the differences are a little more obvious perhaps....
On Fri, Nov 12, 2010 at 3:34 AM, Burt Crépeault <[email protected]>wrote: > Hi folks, > > I'm sure the solution to this is right in my face but I have been looking > (without success, obviously) for a way to know if a doctrine object has > changed after its form has been saved. I'd like to display a banner saying > "your information was saved" whenever it has indeed changed, but not > otherwise (such as when the user presses save but has changed nothing in the > form). > > My first crack at it: > > $oldstate = Doctrine::getTable('myClass')->find($id); > $form->save(); > $newstate = Doctrine::getTable('myClass')->find($id); > > if ($oldstate != $newstate) return 'changes'; > else return 'nochanges'; > > Somehow, this always returns 'nochange'. > > Stumped! > Thanks! > > Burt. > > > -- > 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 [email protected] > To unsubscribe from this group, send email to > [email protected]<symfony-users%[email protected]> > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- Gareth McCumskey http://garethmccumskey.blogspot.com twitter: @garethmcc -- 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
