Hello,
I have the following code:
$sites = $this->Sites->find()
->contain([
'Sitecategories',
'Sitedescriptions.Languages',
'Countries',
'Users'
])
->where([
'postcode LIKE' => $this->request->data['numero'] . '%'
])
->sortBy(function($row) { return substr($row->postcode, 0, 2); }, SORT_ASC);
debug($sites);
displays:
object(Cake\Collection\Iterator\SortIterator) {
'count' => (int) 428
}
And so I’m very desappointed because I don’t understand how to access to that count
var.