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

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

Orders the values mapped from the supplied function ascendingly Example function:
public orderByAscending ( callable $function ) : Pinq\Interfaces\IOrderedTraversable
$function callable The mapping function
Результат Pinq\Interfaces\IOrderedTraversable
    public function orderByAscending(callable $function);

Usage Example

Пример #1
0
 /**
  * @dataProvider people
  */
 public function testOrderByMultipleColumns(\Pinq\ITraversable $traversable, array $data)
 {
     $orderedNames = $traversable->orderByAscending(function ($i) {
         return $i['firstName'];
     })->thenByDescending(function ($i) {
         return $i['lastName'];
     })->implode(':', function ($i) {
         return $i['firstName'] . ' ' . $i['lastName'];
     });
     $this->assertEquals('Alex Katter:Beth Baronksy:Casy Denali:Daniel Farmer:Daniel Dekresta:Dave Desopolous:David Faller:Hugo Tesserat:Sandy Williams:Zoe Black', $orderedNames);
 }
All Usage Examples Of Pinq\ITraversable::orderByAscending