1 | <?php |
||
10 | class Sort |
||
11 | { |
||
12 | /** @var string */ |
||
13 | protected $sortClass; |
||
14 | |||
15 | /** @var string */ |
||
16 | protected $property; |
||
17 | |||
18 | /** @var string */ |
||
19 | protected $defaultDirection; |
||
20 | |||
21 | public function __construct(string $property, $sortClass) |
||
27 | |||
28 | public static function parsePropertyDirection(string $property): string |
||
32 | |||
33 | public function sort(Builder $builder, ?bool $descending = null) |
||
41 | |||
42 | public static function field(string $property) : self |
||
46 | |||
47 | public static function custom(string $property, $sortClass) : self |
||
51 | |||
52 | public function getProperty(): string |
||
56 | |||
57 | public function isForProperty(string $property): bool |
||
61 | |||
62 | private function resolveSortClass(): CustomSort |
||
70 | } |
||
71 |