orderBy() public method

Returns new instance of collection.
public orderBy ( string | array $column, string $direction = self::ASC ) : Nextras\Orm\Collection\ICollection
$column string | array column name or array of column names
$direction string sorting direction self::ASC or self::DESC
return Nextras\Orm\Collection\ICollection
Ejemplo n.º 1
0
 protected function applyDefaultOrder(ICollection $collection)
 {
     if ($this->metadata->relationship->order !== NULL) {
         return $collection->orderBy($this->metadata->relationship->order[0], $this->metadata->relationship->order[1]);
     } else {
         return $collection;
     }
 }