Hey All,

I have a model, hasMany associated-model, and I'm finding when using
the beforeFind callback inside associated-model, it is called more
times than I'm expecting.  For each associated record found it is
called (with results like  [0][associated-model]), and then for all
the records together it is called again (with results like [0]
[associated-model][n]).

My original issue was I was using beforeFind to do something toggling
of values, which where being re-toggled in the final beforeFind call.
I've worked around the problem, but I was hoping someone could shed
some light on why this happens at all.

>From what I can figure out so far, the first set of calls for the
individual results, and the last call for all the results together,
are triggered from 2 different points in read() in dbo_source.php.  It
looks like to me __filterResults() is being called via
queryAssociation() for each record at line 661, and then again for all
of them when the loop ends, at line 666 (appropriately so for
something I though was an "evil bug").  This also looks on purpose to
me, but I am wondering why.

Using 1.2.0.7296 RC2
Thanks!


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to