1 | <?php |
||
8 | abstract class Compiler |
||
9 | { |
||
10 | /** |
||
11 | * $items. |
||
12 | * |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $items = []; |
||
16 | |||
17 | /** |
||
18 | * $model. |
||
19 | * |
||
20 | * @var mixed |
||
21 | */ |
||
22 | protected $model; |
||
23 | |||
24 | /** |
||
25 | * __construct. |
||
26 | * |
||
27 | * @param \Illuminate\Database\Eloquent\Model $model |
||
28 | */ |
||
29 | 39 | public function __construct($model) |
|
33 | |||
34 | /** |
||
35 | * push. |
||
36 | * |
||
37 | * @param \Recca0120\Repository\Criteria $criteria |
||
38 | * @return $this |
||
39 | */ |
||
40 | 39 | public function push($criteria) |
|
50 | |||
51 | /** |
||
52 | * apply. |
||
53 | * |
||
54 | * @return mixed |
||
55 | */ |
||
56 | 39 | public function apply() |
|
65 | |||
66 | /** |
||
67 | * defaults apply. |
||
68 | * |
||
69 | * @param mixed $model |
||
70 | * @param array $actions |
||
71 | * @return mixed |
||
72 | */ |
||
73 | 13 | public function defaults($model, $actions) |
|
79 | |||
80 | /** |
||
81 | * isExpression. |
||
82 | * |
||
83 | * @param mixed$param |
||
84 | * @return bool |
||
85 | */ |
||
86 | 13 | protected function isExpression($param) |
|
90 | |||
91 | /** |
||
92 | * groupByType. |
||
93 | * |
||
94 | * @return array |
||
95 | */ |
||
96 | protected function groupByType() |
||
109 | |||
110 | /** |
||
111 | * convertToCriteria. |
||
112 | * |
||
113 | * @param array $value |
||
114 | * @return \Recca0120\Repository\Criteria |
||
115 | */ |
||
116 | 4 | protected function convertToCriteria($value, $key) |
|
123 | |||
124 | /** |
||
125 | * transformParameters. |
||
126 | * |
||
127 | * @param array $parameters |
||
128 | * @return array |
||
129 | */ |
||
130 | abstract protected function compileParameters($parameters); |
||
131 | } |
||
132 |