Just add your favorite property back and use the beforeFind () callback in the Table object to add the value from the property to the query.
Or just create a custom search :
public function findOrdered(Query $query, $options) { return $query->order([ $this->alias() . '.name' => 'ASC' ]); }
And use it
$this->find('list')->find('ordered')->all();
Or create an ordered list that returns the entire ordered list.
public function findOrderedList(Query $query, $options) { return $this->findList($query, $options) ->order([ $this->alias() . '.name' => 'ASC' ]); }
Or, overload the findList () method directly and call the parent.
Or, if your find() gets called through a relation, you can set the default order for the relations using the sort option.
$this->hasMany('AuditLogs', [ 'sort' => [ 'AuditLogs.timestamp' => 'desc', ], ]);
source share