@Richtermeister:

Good idea, I dumped the serialized objects before and after and they
are indeed different, although not in the updated_at field which I'm
not using. This is what I got:

Before:

string(2636) "C:8:"Supplier":1864:{a:14:{s:3:"_id";a:1:{s:2:"id";i:8;}
s:5:"_data";a:40:{s:2:"id";i:8;s:13:"name_supplier";s:15:"Saloon
Marielaa";s:12:"civic_number";s:4:"2345";s:8:"address1";s:12:"STREET
RRRRR";s:5:"noapp";s:0:"";s:8:"address2";s:0:"";s:11:"postal_code";s:
7:"G1G 1K4";s:10:"telephone1";s:12:"418-345-9990";s:10:"telephone2";s:
12:"418-473-4669";s:11:"login_email";s:21:"[email protected]";s:
8:"password";s:32:"202cb962ac59075b964b07152d234b70";s:
13:"password_hash";N;s:12:"web_site_url";s:0:"";s:10:"created_on";s:
10:"2009-05-05";s:12:"unsubscribed";b:0;s:7:"enabled";b:1;s:
12:"self_enabled";b:1;s:16:"profile_complete";b:1;s:5:"score";i:0;s:
14:"clicks_in_bank";i:30;s:22:"clicks_in_subscription";i:0;s:
25:"sponsored_results_in_bank";i:0;s:
33:"sponsored_results_in_subscription";i:0;s:14:"accepted_terms";i:6;s:
10:"image_logo";s:29:"8_Cuisine-verte-20080002.jpeg";s:
16:"image_logo_thumb";s:39:"8_Cuisine-verte-20080002.jpeg_thumb.png";s:
25:"intervention_max_distance";i:15;s:19:"state_full_presence";b:0;s:
20:"region_full_presence";b:1;s:16:"perimeter_string";s:
252:"46.8831,-71.093235|46.95048,-71.11965|46.999806,-71.191817|
47.01786,-71.2904|46.955887,-71.306076|46.95048,-71.46115|
46.8831,-71.487565|46.81572,-71.46115|46.766394,-71.388983|
46.74834,-71.2904|46.766394,-71.191817|46.81572,-71.11965|
46.8831,-71.093235";s:7:"city_id";i:23;s:9:"region_id";i:37;s:
8:"latitude";s:7:"46.8831";s:9:"longitude";s:8:"-71.2904";s:
14:"invoicebyemail";b:1;s:14:"invoicebyposte";b:0;s:
15:"invoicelanguage";s:2:"en";s:15:"next_invoice_on";s:
10:"2010-11-25";s:10:"view_hints";b:1;s:12:"last_hint_id";i:0;}s:
7:"_values";a:0:{}s:6:"_state";i:3;s:13:"_lastModified";a:0:{}s:
9:"_modified";a:0:{}s:10:"_oldValues";a:0:{}s:15:"_pendingDeletes";a:0:
{}s:15:"_pendingUnlinks";a:0:{}s:20:"_serializeReferences";b:0;s:
17:"_invokedSaveHooks";b:0;s:4:"_oid";i:2;s:8:"_locator";N;s:
10:"_resources";a:0:{}}}"


After:

string(2638) "C:8:"Supplier":1866:{a:14:{s:3:"_id";a:1:{s:2:"id";i:8;}
s:5:"_data";a:40:{s:2:"id";i:8;s:13:"name_supplier";s:15:"Saloon
Marielaa";s:12:"civic_number";s:4:"2345";s:8:"address1";s:12:"STREET
RRRRR";s:5:"noapp";s:0:"";s:8:"address2";s:0:"";s:11:"postal_code";s:
7:"G1G 1K4";s:10:"telephone1";s:12:"418-345-9990";s:10:"telephone2";s:
12:"418-473-4669";s:11:"login_email";s:21:"[email protected]";s:
8:"password";s:32:"202cb962ac59075b964b07152d234b70";s:
13:"password_hash";N;s:12:"web_site_url";s:0:"";s:10:"created_on";s:
10:"2009-05-05";s:12:"unsubscribed";b:0;s:7:"enabled";b:1;s:
12:"self_enabled";b:1;s:16:"profile_complete";b:1;s:5:"score";i:0;s:
14:"clicks_in_bank";i:30;s:22:"clicks_in_subscription";i:0;s:
25:"sponsored_results_in_bank";i:0;s:
33:"sponsored_results_in_subscription";i:0;s:14:"accepted_terms";i:6;s:
10:"image_logo";s:29:"8_Cuisine-verte-20080002.jpeg";s:
16:"image_logo_thumb";s:39:"8_Cuisine-verte-20080002.jpeg_thumb.png";s:
25:"intervention_max_distance";i:15;s:19:"state_full_presence";b:0;s:
20:"region_full_presence";b:1;s:16:"perimeter_string";s:
252:"46.8831,-71.093235|46.95048,-71.11965|46.999806,-71.191817|
47.01786,-71.2904|46.955887,-71.306076|46.95048,-71.46115|
46.8831,-71.487565|46.81572,-71.46115|46.766394,-71.388983|
46.74834,-71.2904|46.766394,-71.191817|46.81572,-71.11965|
46.8831,-71.093235";s:7:"city_id";i:23;s:9:"region_id";i:37;s:
8:"latitude";s:7:"46.8831";s:9:"longitude";s:8:"-71.2904";s:
14:"invoicebyemail";b:1;s:14:"invoicebyposte";b:0;s:
15:"invoicelanguage";s:2:"en";s:15:"next_invoice_on";s:
10:"2010-11-25";s:10:"view_hints";b:1;s:12:"last_hint_id";i:0;}s:
7:"_values";a:0:{}s:6:"_state";i:3;s:13:"_lastModified";a:0:{}s:
9:"_modified";a:0:{}s:10:"_oldValues";a:0:{}s:15:"_pendingDeletes";a:0:
{}s:15:"_pendingUnlinks";a:0:{}s:20:"_serializeReferences";b:0;s:
17:"_invokedSaveHooks";a:0:{}s:4:"_oid";i:2;s:8:"_locator";N;s:
10:"_resources";a:0:{}}}"

The difference is in the _invokedSaveHooks field on the last line,
where before it's a boolean value, after becomes an empty array. I
have no idea what it means...

@Daniel Lohse:

This might indeed be what I'm looking for, I've give it a try and post
results back here when I have them.

Thanks all

Burt.


On Nov 12, 10:38 am, Daniel Lohse <[email protected]>
wrote:
> What do you want to do? Before you save the form (and therefore the object), 
> you can get at the changes like described 
> here:http://groups.google.com/group/symfony-users/browse_thread/thread/be4...
>
> Just add the doUpdateObject method to your form, call parent::doUpdateObject 
> and then you can inspect the changes by calling 
> $this->getObject()->getModified(false) to get the changed fields and their 
> new values (call $this->getObject()->getModified(true) to get the old values).
>
> Cheers, Daniel
>
> PS: You can also find out more about the form saving process 
> here:http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-F...
>
> On 12.11.2010, at 16:03, LeBurt 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 [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

-- 
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

Reply via email to