CakePHP: How do I order results based on a 2-level deep association model?
- by KcYxA
I'm hoping I won't need to resort to custom queries.
A related question would be: how do I retrieve data so that if an associated model is empty, no record is retrieved at all, as opposed to an empty array for an associated model?
As an oversimplified example, say I have the following models:
City -- Street -- House
How do I sort City results by…