| 1 | <?php |
||
| 15 | class OrderBy extends Criterion |
||
| 16 | { |
||
| 17 | public const ASC = 'ASC'; |
||
| 18 | public const DESC = 'DESC'; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var bool |
||
| 22 | */ |
||
| 23 | private $asc; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * OrderBy constructor. |
||
| 27 | * @param string $field |
||
| 28 | * @param bool $asc |
||
| 29 | */ |
||
| 30 | 2 | public function __construct(string $field, bool $asc = true) |
|
| 35 | |||
| 36 | /** |
||
| 37 | * @return string |
||
| 38 | */ |
||
| 39 | 2 | public function getDirection(): string |
|
| 43 | |||
| 44 | /** |
||
| 45 | * @return bool |
||
| 46 | */ |
||
| 47 | public function isAsc(): bool |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return bool |
||
| 54 | */ |
||
| 55 | public function isDesc(): bool |
||
| 59 | } |
||
| 60 |