I'm developing an application using cakephp 3.0. I'm wondering if the paginator allows to sort fields coming from other tables which are included in the 'contain' clause. For example I have this statement:
$this->paginate = [
'contain' => ['Actors']
];
The table 'Actors' contains the field 'description'. Is it possible to sort by the description field of the table Actors?
I tried to specify the field using the dot notation:
$this->Paginator->sort('Actors.description', __('Description'))
as well as to include the model within the option array:
$this->Paginator->sort('description', __('Description'), ['model' => 'Actors'])
In both cases it doesn't seem to work. These two approaches come from cakephp 2.0 where everything works fine (cakephp Paginator -> sort - model option). Apparently in the new documentation there aren't any updates.