Total Complexity | 6 |
Total Lines | 67 |
Duplicated Lines | 0 % |
Coverage | 81.25% |
Changes | 0 |
1 | <?php |
||
10 | class OrderBy implements CriteriaInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $column; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $direction; |
||
21 | |||
22 | /** |
||
23 | * Allowed characters for order by column |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $allowedToContain = '/^[a-z0-9\.\_\-]+$/i'; |
||
28 | |||
29 | /** |
||
30 | * OrderBy constructor. |
||
31 | * |
||
32 | * @param mixed $orderBy |
||
33 | */ |
||
34 | 4 | public function __construct($orderBy) |
|
37 | 4 | } |
|
38 | |||
39 | /** |
||
40 | * @param $orderBy |
||
41 | * |
||
42 | * @return void |
||
43 | */ |
||
44 | 3 | public function setOrderByParameters($orderBy): void |
|
53 | } |
||
54 | 3 | } |
|
55 | |||
56 | /** |
||
57 | * @param $model |
||
58 | * @param RepositoryInterface $repository |
||
59 | * |
||
60 | * @throws ValidationException |
||
61 | * |
||
62 | * @return Builder |
||
63 | */ |
||
64 | 2 | public function apply($model, RepositoryInterface $repository): Builder |
|
79 |