proved too complex for a newbie like me.
Instead I just handled it the afterSave() of the "child" method. I
just force the update of the 'modified' field there.
I'll work on a more generic way to do this when I have more cake
experience = )
Thank You.
On Jan 25, 9:56 am, euromark <dereurom...@googlemail.com> wrote:
> i would use a behavior "ModifyUpdatable" or something
> that checks if there are any "parent relations" and if so triggers the
> update of the timestamps
>
> for performance issues you could manually define the parent relations
> to be modified
> so it can update right away instead of checking on existing "modified"
> fields in the table
>
> i guess lots of cakers could find this piece of snippet very useful -
> including me :)
>
> On 25 Jan., 16:25, Javier <domingo_deje...@sbcglobal.net> wrote:
>
>
>
> > Is it possible to automagically update 'modified' field in a
> > 'belongsTo' table when a table is updated.
>
> > my example is this: I have two tables with 'modified'
> > fields...'families' and 'family_members'. models are Family hasMany
> > FamiyMember, FamilyMember belongsTo Family.
>
> > When I edit an existing family_member the 'modified' field gets
> > updated in 'family_members' table. I would like 'modified' to get
> > updated in the 'families' table as well. How can I do that?
>
> > thanx in advance
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment