Total Complexity | 4 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | class Ordening extends AbstractQuery implements OrdeningInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var array |
||
14 | */ |
||
15 | private $query; |
||
16 | |||
17 | /** |
||
18 | * @param string $key |
||
19 | * @param RethinkInterface $rethink |
||
20 | * @param MessageInterface $message |
||
21 | */ |
||
22 | public function __construct(string $key, RethinkInterface $rethink, MessageInterface $message) |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @inheritdoc |
||
31 | */ |
||
32 | public function asc(string $key): OrdeningInterface |
||
33 | { |
||
34 | $this->query = [ |
||
35 | TermType::ASC, |
||
36 | [ |
||
37 | $key, |
||
38 | ], |
||
39 | ]; |
||
40 | |||
41 | return $this; |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @inheritdoc |
||
46 | */ |
||
47 | public function desc(string $key): OrdeningInterface |
||
48 | { |
||
49 | $this->query = [ |
||
50 | TermType::DESC, |
||
51 | [ |
||
52 | $key, |
||
53 | ], |
||
54 | ]; |
||
55 | |||
56 | return $this; |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @inheritdoc |
||
61 | */ |
||
62 | public function toArray(): array |
||
65 | } |
||
66 | } |
||
67 |