1 | <?php |
||
20 | class FieldSort implements BuilderInterface |
||
21 | { |
||
22 | use ParametersTrait; |
||
23 | |||
24 | const ASC = 'asc'; |
||
25 | const DESC = 'desc'; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $field; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | private $order; |
||
36 | |||
37 | /** |
||
38 | * @var BuilderInterface |
||
39 | */ |
||
40 | private $nestedFilter; |
||
41 | |||
42 | /** |
||
43 | * @param string $field Field name. |
||
44 | * @param string $order Order direction. |
||
45 | * @param array $params Params that can be set to field sort. |
||
46 | */ |
||
47 | public function __construct($field, $order = null, $params = []) |
||
53 | |||
54 | /** |
||
55 | * @return BuilderInterface |
||
56 | */ |
||
57 | public function getNestedFilter() |
||
61 | |||
62 | /** |
||
63 | * @param BuilderInterface $nestedFilter |
||
64 | */ |
||
65 | public function setNestedFilter(BuilderInterface $nestedFilter) |
||
69 | |||
70 | /** |
||
71 | * Returns element type. |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | public function getType() |
||
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | public function toArray() |
||
99 | } |
||
100 |