You are here

public function Criteria::orderBy in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/doctrine/collections/lib/Doctrine/Common/Collections/Criteria.php \Doctrine\Common\Collections\Criteria::orderBy()

Sets the ordering of the result of this Criteria.

Keys are field and values are the order, being either ASC or DESC.

Parameters

string[] $orderings:

Return value

Criteria

See also

Criteria::ASC

Criteria::DESC

1 call to Criteria::orderBy()
Criteria::__construct in vendor/doctrine/collections/lib/Doctrine/Common/Collections/Criteria.php
Construct a new Criteria.

File

vendor/doctrine/collections/lib/Doctrine/Common/Collections/Criteria.php, line 200

Class

Criteria
Criteria for filtering Selectable collections.

Namespace

Doctrine\Common\Collections

Code

public function orderBy(array $orderings) {
  $this->orderings = array_map(function ($ordering) {
    return strtoupper($ordering) === Criteria::ASC ? Criteria::ASC : Criteria::DESC;
  }, $orderings);
  return $this;
}