1 | <?php |
||
12 | abstract class base_mapper implements mapper_interface |
||
13 | { |
||
14 | /** @var \phpbb\db\driver\driver_interface */ |
||
15 | protected $db; |
||
16 | |||
17 | /** @var \blitze\sitemaker\model\base_collection */ |
||
18 | protected $collection; |
||
19 | |||
20 | /** @var \blitze\sitemaker\model\mapper_factory */ |
||
21 | protected $mapper_factory; |
||
22 | |||
23 | /** @var string */ |
||
24 | protected $entity_table; |
||
25 | |||
26 | /** @var string */ |
||
27 | protected $entity_class; |
||
28 | |||
29 | /** @var string */ |
||
30 | protected $entity_pkey; |
||
31 | |||
32 | /** |
||
33 | * Constructor |
||
34 | * |
||
35 | * @param \phpbb\db\driver\driver_interface $db Database object |
||
36 | * @param \blitze\sitemaker\model\base_collection $collection Entity collection |
||
37 | * @param \blitze\sitemaker\model\mapper_factory $mapper_factory Mapper factory object |
||
38 | * @param string $entity_table |
||
39 | */ |
||
40 | 118 | public function __construct(\phpbb\db\driver\driver_interface $db, \blitze\sitemaker\model\base_collection $collection, \blitze\sitemaker\model\mapper_factory $mapper_factory, $entity_table) |
|
47 | |||
48 | /** |
||
49 | * Get the collection |
||
50 | */ |
||
51 | public function get_collection() |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | 56 | public function load(array $condition = array()) |
|
72 | |||
73 | /** |
||
74 | * {@inheritdoc} |
||
75 | */ |
||
76 | 43 | public function find(array $condition = array()) |
|
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | 27 | public function save(\blitze\sitemaker\model\entity_interface $entity) |
|
108 | |||
109 | /** |
||
110 | * {@inheritdoc} |
||
111 | */ |
||
112 | 15 | public function delete($condition) |
|
130 | |||
131 | /** |
||
132 | * {@inheritdoc} |
||
133 | */ |
||
134 | 72 | public function create_entity(array $row) |
|
138 | |||
139 | /** |
||
140 | * Insert a new row in the table corresponding to the specified entity |
||
141 | * @param \blitze\sitemaker\model\entity_interface $entity |
||
142 | * @return \blitze\sitemaker\model\entity_interface |
||
143 | * @throws \blitze\sitemaker\exception\unexpected_value |
||
144 | */ |
||
145 | 12 | protected function insert(\blitze\sitemaker\model\entity_interface $entity) |
|
159 | |||
160 | /** |
||
161 | * Update the row in the table corresponding to the specified entity |
||
162 | * @param \blitze\sitemaker\model\entity_interface $entity |
||
163 | * @return mixed |
||
164 | * @throws \blitze\sitemaker\exception\unexpected_value |
||
165 | */ |
||
166 | 16 | protected function update(\blitze\sitemaker\model\entity_interface $entity) |
|
179 | |||
180 | /** |
||
181 | * @param array $sql_where |
||
182 | * @return string |
||
183 | */ |
||
184 | 28 | protected function find_sql(array $sql_where) |
|
189 | |||
190 | /** |
||
191 | * @param array $condition |
||
192 | * @return array |
||
193 | */ |
||
194 | 108 | protected function get_sql_condition(array $condition) |
|
212 | |||
213 | /** |
||
214 | * @param array $condition |
||
215 | * @return mixed |
||
216 | */ |
||
217 | 108 | protected function ensure_multi_array(array $condition) |
|
221 | |||
222 | /** |
||
223 | * @param string $field |
||
224 | * @param array $value |
||
225 | * @param string $operator |
||
226 | * @return string |
||
227 | */ |
||
228 | 9 | protected function get_sql_where_array($field, array $value, $operator) |
|
232 | |||
233 | /** |
||
234 | * @param string $field |
||
235 | * @param string $value |
||
236 | * @param string $operator |
||
237 | * @return string |
||
238 | */ |
||
239 | 24 | protected function get_sql_where_string($field, $value, $operator) |
|
243 | |||
244 | /** |
||
245 | * @param string $field |
||
246 | * @param string $value |
||
247 | * @param string $operator |
||
248 | * @return string |
||
249 | */ |
||
250 | 78 | protected function get_sql_where_integer($field, $value, $operator) |
|
254 | |||
255 | /** |
||
256 | * @param string $field |
||
257 | * @param bool $value |
||
258 | * @param string $operator |
||
259 | * @return string |
||
260 | */ |
||
261 | protected function get_sql_where_boolean($field, $value, $operator) |
||
265 | } |
||
266 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: