Skip to content

Unable to use Order like Paginate #115

@jayevt

Description

@jayevt

I am using below query to set order direction.

$order[$sortField] = $sortDirection;

$query = $this->getTable()
    ->find('search', ['search' => $requestQuery])
    ->order($order);

I am using below event. It is setting pagination.
$this->dispatchEvent('Action.Crud.afterFindEntities', compact('query', 'records'));

Is it possible to use order automatically instead of setting it manually like paginator.

Paginator Example:

  public $paginate = [
      'limit' => 25,
      'order' => [
          'Articles.title' => 'asc'
      ]
  ];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions