| 1 | <?php |
||
| 14 | abstract class SortClause |
||
| 15 | { |
||
| 16 | const SORT_ASC = 'ascending'; |
||
| 17 | const SORT_DESC = 'descending'; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Sort direction. |
||
| 21 | * |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | public $direction = self::SORT_ASC; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Sort target. |
||
| 28 | * |
||
| 29 | * @var string |
||
| 30 | */ |
||
| 31 | public $target; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Constructs a new SortClause on $sortTarget in direction $sortDirection. |
||
| 35 | * |
||
| 36 | * @param string $sortTarget |
||
| 37 | * @param string $sortDirection one of SortClause::SORT_ASC or SortClause::SORT_DESC |
||
| 38 | * |
||
| 39 | * @throws InvalidArgumentException if the given sort order isn't one of SortClause::SORT_ASC or SortClause::SORT_DESC |
||
| 40 | */ |
||
| 41 | public function __construct($sortTarget, $sortDirection) |
||
| 50 | } |
||
| 51 |