Pinq\ITraversable::orderBy PHP Метод

orderBy() публичный Метод

Orders the values mapped from the supplied function according the supplied direction.
public orderBy ( callable $function, integer $direction ) : Pinq\Interfaces\IOrderedTraversable
$function callable The projection function
$direction integer
Результат Pinq\Interfaces\IOrderedTraversable
    public function orderBy(callable $function, $direction);

Usage Example

Пример #1
0
 public function visitOrderBy(Segments\OrderBy $query)
 {
     $first = true;
     foreach ($query->getOrderings() as $orderFunction) {
         $direction = $this->resolvedParameters[$orderFunction->getIsAscendingId()] ? Direction::ASCENDING : Direction::DESCENDING;
         if ($first) {
             $this->traversable = $this->traversable->orderBy($this->resolvedParameters[$orderFunction->getProjectionFunction()->getCallableId()], $direction);
             $first = false;
         } else {
             $this->traversable = $this->traversable->thenBy($this->resolvedParameters[$orderFunction->getProjectionFunction()->getCallableId()], $direction);
         }
     }
 }
All Usage Examples Of Pinq\ITraversable::orderBy