Hi,
I've read many posts on this topic, but I haven't figured out how to
do it right yet.
I have four models linked together (Transaction hasMany Intermediators
belongsTo Account belongsTo User), and I want to run a query on a
"removed cousin", like $this->Account->Intermediator->Transaction-
>find('Account.id = xx').
Also, I need to optimize queries with LEFT JOINS, since Cake is
creating hundreds of queries for a simple $this->paginate() for
Transactions.
In a nutshell, I need to write my own SQL. A simple $this->query()
works great, but I'm only getting a "flat" array back:
Array
(
[0] => Array
(
[Transaction] => Array (...)
[Intermediator] => Array (...)
[Account] => Array (...)
[User] => Array (...)
)
[1] => Array ...
)
What I want of course is a proper hierarchy of all my models in the
result array.
How would I go about doing that, without doing it all manually in an
afterFind()?
I've tried using the finderQuery property without any success, Cake
just doesn't seem to use the finderQuery at all.
Any insight would be much appreciated.
(Cake 1.2 recent SVN checkout)
Chrs,
Dav
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---