You are here

public function SortsField::setOrder in Search API sorts 8

Overrides the order to sort on.

Parameters

string $order: The direction of the sorting.

1 call to SortsField::setOrder()
SortsField::__construct in src/SortsField.php
Constructs an instance of the value object.

File

src/SortsField.php, line 63

Class

SortsField
A value object for a sorts field.

Namespace

Drupal\search_api_sorts

Code

public function setOrder($order) {
  $this->order = $order == 'desc' ? 'desc' : 'asc';
}