| 1 | <?php |
||
| 8 | final class Sort implements \JsonSerializable |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var string |
||
| 12 | */ |
||
| 13 | private $field; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | private $direction; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var bool |
||
| 22 | */ |
||
| 23 | private $applied; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var UriInterface |
||
| 27 | */ |
||
| 28 | private $toggleUri; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Sort constructor. |
||
| 32 | * @param string $field |
||
| 33 | * @param string|null $direction |
||
| 34 | * @param bool $applied |
||
| 35 | * @param UriInterface|null $uri |
||
| 36 | */ |
||
| 37 | public function __construct(string $field, ?string $direction = null, bool $applied = true, UriInterface $uri = null) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return string |
||
| 47 | */ |
||
| 48 | public function getField(): string |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return string |
||
| 55 | */ |
||
| 56 | public function getDirection(): ?string |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return bool |
||
| 63 | */ |
||
| 64 | public function isApplied(): bool |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @return UriInterface |
||
| 71 | */ |
||
| 72 | public function getToggleUri(): ?UriInterface |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @inheritDoc |
||
| 79 | */ |
||
| 80 | public function jsonSerialize(): array |
||
| 96 | } |
||
| 97 |