1 | <?php |
||
10 | class Sort |
||
11 | { |
||
12 | /** @var string */ |
||
13 | protected $sortClass; |
||
14 | |||
15 | /** @var string|\Spatie\QueryBuilder\Sorts\Sort */ |
||
16 | protected $property; |
||
17 | |||
18 | /** @var string */ |
||
19 | protected $defaultDirection; |
||
20 | |||
21 | /** @var string */ |
||
22 | protected $columnName; |
||
23 | |||
24 | public function __construct(string $property, $sortClass, ?string $columnName = null) |
||
34 | |||
35 | public static function parsePropertyDirection(string $property): string |
||
39 | |||
40 | public function sort(Builder $builder, ?bool $descending = null) |
||
48 | |||
49 | public static function field(string $property, ?string $columnName = null) : self |
||
53 | |||
54 | public static function custom(string $property, $sortClass, ?string $columnName = null) : self |
||
58 | |||
59 | public function getProperty(): string |
||
63 | |||
64 | public function isForProperty(string $property): bool |
||
68 | |||
69 | private function resolveSortClass(): CustomSort |
||
77 | |||
78 | public function getColumnName(): string |
||
82 | } |
||
83 |