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