My problem is that afterFind only executes on the first level
associations of a found model, not on any further.  So if I have
[Campaign hasMany Group] [Group HABTM User] and I find a Campaign
(recursive 2), afterFind runs on the Group, but not the User (this is
using the latest 1.2.x.x branch).

Rather than modify the core, I thought there might be a better way to
do what I want - which is just modify the loaded data.  For example, I
currently have AppModel beforeSave() and afterFind() functions, which
can encode and decode the model data.  I use this for the odd occasion
that I want to store more complex data in a field (say CSV in the
database, but an array on my model).  I'm also using the afterFind to
generate some "meta fields", so Users get a "full_name" field, which is
just a mix of "salutation", "first_name" and "surname".

So, is there a better/alternative place to put these functions?  Or
should I look at modifying the core to ensure the afterFind callback is
run on every model included in the current recursive level?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to