Situation
using Cake 3.2.6
What I want
To display a list of PaymentsByMembers
by the members' role_id
in ascending order followed by their name
In other words I want to order the primary models by the associated data fields.
What I tried
$this->paginate = [
'contain' => [
'Issuers',
'Recipients', 'PaymentTypes'
],
'conditions' => $conditions,
'order' => ['Recipients.role_id' => 'ASC', 'Recipients.name' => 'ASC']
];
what's the relations?
A Payments by Member
belongsTo a Recipient
What did you find?
I can only find a section in the cookbook about filtering by associated data.
There is no equivalent about ordering by associated data.
I will be happy to write that in.