| 1 | <?php |
||
| 18 | class OrderBy extends Criterion |
||
| 19 | { |
||
| 20 | public const ASC = 'ASC'; |
||
| 21 | public const DESC = 'DESC'; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var bool |
||
| 25 | */ |
||
| 26 | private $asc; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var Field |
||
| 30 | */ |
||
| 31 | private $field; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * OrderBy constructor. |
||
| 35 | * @param Query $query |
||
| 36 | * @param string $field |
||
| 37 | * @param bool $asc |
||
| 38 | */ |
||
| 39 | 2 | public function __construct(Query $query, string $field, bool $asc = true) |
|
| 46 | |||
| 47 | /** |
||
| 48 | * @return Field |
||
| 49 | */ |
||
| 50 | 2 | public function getField(): Field |
|
| 54 | |||
| 55 | /** |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | 2 | public function getDirection(): string |
|
| 62 | |||
| 63 | /** |
||
| 64 | * @return bool |
||
| 65 | */ |
||
| 66 | public function isAsc(): bool |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @return bool |
||
| 73 | */ |
||
| 74 | public function isDesc(): bool |
||
| 78 | } |
||
| 79 |