CakePHP: 2-level JOIN with one Query
- by Daniel Magliola
I have the following models in CakePHP:
A Deposit belongs to an Account
An Account belongs to a Customer
I want to have a list of Deposits, and I need to show the name of the customer (so I have to join through the Customer). I also need to paginate this list.
If I set Deposit->recursive = 2, I can get the Customer, however, CakePHP runs one…