1 | <?php namespace Cornford\Logical; |
||
7 | abstract class LogicalAbstract |
||
8 | { |
||
9 | /** |
||
10 | * Logical statement instance. |
||
11 | * |
||
12 | * @var \Cornford\Logical\Contracts\LogicalStatementInterface |
||
13 | */ |
||
14 | protected static $logicalStatementInstance; |
||
15 | |||
16 | /** |
||
17 | * Property accessor instance. |
||
18 | * |
||
19 | * @var \Symfony\Component\PropertyAccess\PropertyAccessor |
||
20 | */ |
||
21 | protected static $propertyAccessorInstance; |
||
22 | |||
23 | /** |
||
24 | * The input array. |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $input = []; |
||
29 | |||
30 | /** |
||
31 | * The logic string. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $logic; |
||
36 | |||
37 | /** |
||
38 | * The decoded logic statements. |
||
39 | * |
||
40 | * @var array |
||
41 | */ |
||
42 | protected $decodedLogicStatements = []; |
||
43 | |||
44 | /** |
||
45 | * The output results. |
||
46 | * |
||
47 | * @var array |
||
48 | */ |
||
49 | protected $results = []; |
||
50 | |||
51 | /** |
||
52 | * Construct Logical object. |
||
53 | * |
||
54 | * @param array $input |
||
55 | * @param string|null $logic |
||
56 | * @param LogicalStatementInterface $logicalStatement |
||
57 | */ |
||
58 | public function __construct( |
||
68 | |||
69 | /** |
||
70 | * Set the logical statement instance. |
||
71 | * |
||
72 | * @param LogicalStatementInterface $value |
||
73 | * |
||
74 | * @return void |
||
75 | */ |
||
76 | public function setLogicalStatementInstance(LogicalStatementInterface $value) |
||
80 | |||
81 | /** |
||
82 | * Get the logic statement instance. |
||
83 | * |
||
84 | * @return LogicalStatementInterface |
||
85 | */ |
||
86 | public function getLogicalStatementInstance() |
||
90 | |||
91 | /** |
||
92 | * Get the property accessor instance. |
||
93 | * |
||
94 | * @return PropertyAccessor |
||
95 | */ |
||
96 | protected function getPropertyAccessorInstance() |
||
100 | |||
101 | /** |
||
102 | * Set the input value. |
||
103 | * |
||
104 | * @param array $value |
||
105 | * |
||
106 | * @return void |
||
107 | */ |
||
108 | public function setInput(array $value = []) |
||
112 | |||
113 | /** |
||
114 | * Get the input value. |
||
115 | * |
||
116 | * @return array |
||
117 | */ |
||
118 | public function getInput() |
||
122 | |||
123 | /** |
||
124 | * Set the logic value. |
||
125 | * |
||
126 | * @param string $value |
||
127 | * |
||
128 | * @return void |
||
129 | */ |
||
130 | public function setLogic($value) |
||
134 | |||
135 | /** |
||
136 | * Get the logic value. |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | public function getLogic() |
||
144 | |||
145 | /** |
||
146 | * Set a decoded logic statements value. |
||
147 | * |
||
148 | * @param array $value |
||
149 | * |
||
150 | * @return void |
||
151 | */ |
||
152 | protected function setDecodedLogicStatements($value) |
||
156 | |||
157 | /** |
||
158 | * Set a decoded logic statement value. |
||
159 | * |
||
160 | * @param array $value |
||
161 | * |
||
162 | * @return void |
||
163 | */ |
||
164 | protected function setDecodedLogicStatement($value) |
||
172 | |||
173 | /** |
||
174 | * Get the decoded logic statements value. |
||
175 | * |
||
176 | * @return array |
||
177 | */ |
||
178 | protected function getDecodedLogicStatements() |
||
182 | |||
183 | /** |
||
184 | * Set the results value. |
||
185 | * |
||
186 | * @param array $value |
||
187 | * |
||
188 | * @return void |
||
189 | */ |
||
190 | protected function setResults($value) |
||
194 | |||
195 | /** |
||
196 | * Merge the results value with an input results value. |
||
197 | * |
||
198 | * @param array $value |
||
199 | * |
||
200 | * @return void |
||
201 | */ |
||
202 | protected function mergeResults($value) |
||
216 | |||
217 | /** |
||
218 | * Get the results value. |
||
219 | * |
||
220 | * @return array |
||
221 | */ |
||
222 | public function getResults() |
||
226 | |||
227 | /** |
||
228 | * Reset items. |
||
229 | * |
||
230 | * @return self |
||
231 | */ |
||
232 | public function reset() |
||
241 | } |
||
242 |