This happens to me quite frequently:

I define on my Post model a nifty afterFind method which alters in
somewhay the results. And it works nice when I do a $this->Post->find
().

Then I want to, say, find all posts from an author (Author hasMany
Post):

$conditions = array('Author.id =' => 123);
$this->Author->find('all', compact('conditions'));

But then no afterFind() filtering is done anymore on the Post results.

I understand why, but either workaround is ugly:
1) Defining a quite similar afterFind() method on AuthorController.
2) Doing two finds (one on each model) and then array_merge().

I wonder if anybody here has found a cool solution to this.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to