Sure, I got it. What I puzzled is where I should write isModified( ) if I want to get all modified fields when "Save" button is clicked?Thanks.
xj On Sat, Feb 7, 2009 at 12:25 PM, Jonathan Wage <jonw...@gmail.com> wrote: > You are calling isModified before anything is being done. The > parent::executeUpdate() is the line that triggers the changing of properties > on the object. > > - Jon > > > On Fri, Feb 6, 2009 at 10:19 PM, Xin Jia <xinjia...@gmail.com> wrote: > >> Thank you, Klemens. I tried to use this method in these codes below in >> Admin Generator but all failed:(~ :model name) >> >> (1)~Form::doSave( ) >> >> public function doSave($con = null) >> { >> if (!$this->isNew() && $this->getObject()->isModified()) >> { >> var_dump($this->getObject()->isModified()); >> } >> return parent::doSave($con); >> } >> >> >> (2)~Actions::executeUpdate( ) >> >> public function executeUpdate(sfWebRequest $request) >> { >> var_dump($this->getRoute()->getObject()->isModified()); >> return parent::executeUpdate($request); >> } >> >> Could you help me on how to fix it?Thanks. >> >> xj >> >> >> On Sat, Feb 7, 2009 at 4:18 AM, klemens_u <klem...@ull.at> wrote: >> >>> >>> Hi, >>> >>> can you give a failing example and the version of symfony you're >>> using? >>> >>> I'm using sf 1.2 and the following works for me: >>> >>> $record = Doctrine::getTable('User')->find(1); >>> $record->first_name = 'hugo'; >>> var_dump($x->getModified()); >>> >>> returns: >>> >>> array(1) { >>> ["first_name"]=> >>> string(4) "hugo" >>> } >>> >>> :-) Klemens >>> >>> On 6 Feb., 15:39, XinJia <xinjia...@gmail.com> wrote: >>> > Hi all, >>> > >>> > Could anybody show me an example to use Doctrine_Record::getModified() >>> > or is it a bug? I'm puzzled for I always got an empty array while I >>> > indeed updated a field. Thanks. >>> > >>> > xj >>> >>> >> >> >> > > > -- > Jonathan H. Wage > Open Source Software Developer & Evangelist > http://www.jwage.com > http://www.doctrine-project.org > http://www.symfony-project.org > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---