function Sort::__construct

Same name and namespace in other branches
  1. 8.9.x core/modules/jsonapi/src/Query/Sort.php \Drupal\jsonapi\Query\Sort::__construct()
  2. 10 core/modules/jsonapi/src/Query/Sort.php \Drupal\jsonapi\Query\Sort::__construct()
  3. 11.x core/modules/jsonapi/src/Query/Sort.php \Drupal\jsonapi\Query\Sort::__construct()

Constructs a new Sort object.

Takes an array of sort fields. Example: [ [ 'path' => 'changed', 'direction' => 'DESC', ], [ 'path' => 'title', 'direction' => 'ASC', 'langcode' => 'en-US', ], ]

Parameters

array $fields: The entity query sort fields.

File

core/modules/jsonapi/src/Query/Sort.php, line 73

Class

Sort
Gathers information about the sort parameter.

Namespace

Drupal\jsonapi\Query

Code

public function __construct(array $fields) {
    $this->fields = $fields;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.