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) |
|
56 | |||
57 | /** |
||
58 | * apply. |
||
59 | * |
||
60 | * @return mixed |
||
61 | */ |
||
62 | 39 | public function apply() |
|
82 | |||
83 | /** |
||
84 | * defaults apply. |
||
85 | * |
||
86 | * @param mixed $model |
||
87 | * @param array $actions |
||
88 | * @return mixed |
||
89 | */ |
||
90 | public function defaults($model, $actions) |
||
96 | |||
97 | /** |
||
98 | * isExpression. |
||
99 | * |
||
100 | * @param mixed$param |
||
101 | * @return bool |
||
102 | */ |
||
103 | 13 | protected function isExpression($param) |
|
107 | |||
108 | /** |
||
109 | * transformParameters. |
||
110 | * |
||
111 | * @param array $parameters |
||
112 | * @return array |
||
113 | */ |
||
114 | abstract protected function compileParameters($parameters); |
||
115 | } |
||
116 |