1 | <?php |
||
41 | class ProductMediaProcessor implements ProductMediaProcessorInterface |
||
42 | { |
||
43 | |||
44 | /** |
||
45 | * A PDO connection initialized with the values from the Doctrine EntityManager. |
||
46 | * |
||
47 | * @var \TechDivision\Import\Connection\ConnectionInterface |
||
48 | */ |
||
49 | protected $connection; |
||
50 | |||
51 | /** |
||
52 | * The repository to load product media galleries. |
||
53 | * |
||
54 | * @var \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryRepository |
||
55 | */ |
||
56 | protected $productMediaGalleryRepository; |
||
57 | |||
58 | /** |
||
59 | * The repository to load product media gallery to entities. |
||
60 | * |
||
61 | * @var \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueToEntityRepository |
||
62 | */ |
||
63 | protected $productMediaGalleryValueToEntityRepository; |
||
64 | |||
65 | /** |
||
66 | * The repository to load product media gallery values. |
||
67 | * |
||
68 | * @var \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueRepository |
||
69 | */ |
||
70 | protected $productMediaGalleryValueRepository; |
||
71 | |||
72 | /** |
||
73 | * The action with the product media gallery CRUD methods. |
||
74 | * |
||
75 | * @var \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction |
||
76 | */ |
||
77 | protected $productMediaGalleryAction; |
||
78 | |||
79 | /** |
||
80 | * The action with the product media gallery value CRUD methods. |
||
81 | * |
||
82 | * @var \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryValueAction |
||
83 | */ |
||
84 | protected $productMediaGalleryValueAction; |
||
85 | |||
86 | /** |
||
87 | * The action with the product media gallery value to entity CRUD methods. |
||
88 | * |
||
89 | * @var \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryValueToEntityAction |
||
90 | */ |
||
91 | protected $productMediaGalleryValueToEntityAction; |
||
92 | |||
93 | /** |
||
94 | * The action with the product media gallery video CRUD methods. |
||
95 | * |
||
96 | * @var \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryValueVideoAction |
||
97 | */ |
||
98 | protected $productMediaGalleryVideoAction; |
||
99 | |||
100 | /** |
||
101 | * Initialize the processor with the necessary assembler and repository instances. |
||
102 | * |
||
103 | * @param \TechDivision\Import\Connection\ConnectionInterface $connection The connection to use |
||
104 | * @param \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryRepository $productMediaGalleryRepository The product media gallery repository to use |
||
105 | * @param \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueRepository $productMediaGalleryValueRepository The product media gallery value repository to use |
||
106 | * @param \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueToEntityRepository $productMediaGalleryValueToEntityRepository The product media gallery value to entity repository to use |
||
107 | * @param \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction $productMediaGalleryAction The product media gallery action to use |
||
108 | * @param \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryValueAction $productMediaGalleryValueAction The product media gallery value action to use |
||
109 | * @param \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryValueToEntityAction $productMediaGalleryValueToEntityAction The product media gallery value to entity action to use |
||
110 | * @param \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryValueVideoAction $productMediaGalleryValueVideoAction The product media gallery value video action to use |
||
111 | */ |
||
112 | public function __construct( |
||
131 | |||
132 | /** |
||
133 | * Set's the passed connection. |
||
134 | * |
||
135 | * @param \TechDivision\Import\Connection\ConnectionInterface $connection The connection to set |
||
136 | * |
||
137 | * @return void |
||
138 | */ |
||
139 | public function setConnection(ConnectionInterface $connection) |
||
143 | |||
144 | /** |
||
145 | * Return's the connection. |
||
146 | * |
||
147 | * @return \TechDivision\Import\Connection\ConnectionInterface The connection instance |
||
148 | */ |
||
149 | public function getConnection() |
||
153 | |||
154 | /** |
||
155 | * Turns off autocommit mode. While autocommit mode is turned off, changes made to the database via the PDO |
||
156 | * object instance are not committed until you end the transaction by calling ProductProcessor::commit(). |
||
157 | * Calling ProductProcessor::rollBack() will roll back all changes to the database and return the connection |
||
158 | * to autocommit mode. |
||
159 | * |
||
160 | * @return boolean Returns TRUE on success or FALSE on failure |
||
161 | * @link http://php.net/manual/en/pdo.begintransaction.php |
||
162 | */ |
||
163 | public function beginTransaction() |
||
167 | |||
168 | /** |
||
169 | * Commits a transaction, returning the database connection to autocommit mode until the next call to |
||
170 | * ProductProcessor::beginTransaction() starts a new transaction. |
||
171 | * |
||
172 | * @return boolean Returns TRUE on success or FALSE on failure |
||
173 | * @link http://php.net/manual/en/pdo.commit.php |
||
174 | */ |
||
175 | public function commit() |
||
179 | |||
180 | /** |
||
181 | * Rolls back the current transaction, as initiated by ProductProcessor::beginTransaction(). |
||
182 | * |
||
183 | * If the database was set to autocommit mode, this function will restore autocommit mode after it has |
||
184 | * rolled back the transaction. |
||
185 | * |
||
186 | * Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition |
||
187 | * language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit |
||
188 | * COMMIT will prevent you from rolling back any other changes within the transaction boundary. |
||
189 | * |
||
190 | * @return boolean Returns TRUE on success or FALSE on failure |
||
191 | * @link http://php.net/manual/en/pdo.rollback.php |
||
192 | */ |
||
193 | public function rollBack() |
||
197 | |||
198 | /** |
||
199 | * Set's the repository to load product media gallery data. |
||
200 | * |
||
201 | * @param \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryRepository $productMediaGalleryRepository The repository instance |
||
202 | * |
||
203 | * @return void |
||
204 | */ |
||
205 | public function setProductMediaGalleryRepository($productMediaGalleryRepository) |
||
209 | |||
210 | /** |
||
211 | * Return's the repository to load product media gallery data. |
||
212 | * |
||
213 | * @return \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryRepository The repository instance |
||
214 | */ |
||
215 | public function getProductMediaGalleryRepository() |
||
219 | |||
220 | /** |
||
221 | * Set's the repository to load product media gallery value to entity data. |
||
222 | * |
||
223 | * @param \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueToEntityRepository $productMediaGalleryValueToEntityRepository The repository instance |
||
224 | * |
||
225 | * @return void |
||
226 | */ |
||
227 | public function setProductMediaGalleryValueToEntityRepository($productMediaGalleryValueToEntityRepository) |
||
231 | |||
232 | /** |
||
233 | * Return's the repository to load product media gallery value to entity data. |
||
234 | * |
||
235 | * @return \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueToEntityRepository The repository instance |
||
236 | */ |
||
237 | public function getProductMediaGalleryValueToEntityRepository() |
||
241 | |||
242 | /** |
||
243 | * Set's the repository to load product media gallery value data. |
||
244 | * |
||
245 | * @param \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueRepository $productMediaGalleryValueRepository The repository instance |
||
246 | * |
||
247 | * @return void |
||
248 | */ |
||
249 | public function setProductMediaGalleryValueRepository($productMediaGalleryValueRepository) |
||
253 | |||
254 | /** |
||
255 | * Return's the repository to load product media gallery value data. |
||
256 | * |
||
257 | * @return \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueRepository The repository instance |
||
258 | */ |
||
259 | public function getProductMediaGalleryValueRepository() |
||
263 | |||
264 | /** |
||
265 | * Set's the action with the product media gallery CRUD methods. |
||
266 | * |
||
267 | * @param \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction $productMediaGalleryAction The action with the product media gallery CRUD methods |
||
268 | * |
||
269 | * @return void |
||
270 | */ |
||
271 | public function setProductMediaGalleryAction($productMediaGalleryAction) |
||
275 | |||
276 | /** |
||
277 | * Return's the action with the product media gallery CRUD methods. |
||
278 | * |
||
279 | * @return \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction The action with the product media gallery CRUD methods |
||
280 | */ |
||
281 | public function getProductMediaGalleryAction() |
||
285 | |||
286 | /** |
||
287 | * Set's the action with the product media gallery valueCRUD methods. |
||
288 | * |
||
289 | * @param \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction $productMediaGalleryValueAction The action with the product media gallery value CRUD methods |
||
290 | * |
||
291 | * @return void |
||
292 | */ |
||
293 | public function setProductMediaGalleryValueAction($productMediaGalleryValueAction) |
||
297 | |||
298 | /** |
||
299 | * Return's the action with the product media gallery valueCRUD methods. |
||
300 | * |
||
301 | * @return \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction The action with the product media gallery value CRUD methods |
||
302 | */ |
||
303 | public function getProductMediaGalleryValueAction() |
||
307 | |||
308 | /** |
||
309 | * Set's the action with the product media gallery value to entity CRUD methods. |
||
310 | * |
||
311 | * @param \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction $productMediaGalleryValueToEntityAction The action with the product media gallery value to entity CRUD methods |
||
312 | * |
||
313 | * @return void |
||
314 | */ |
||
315 | public function setProductMediaGalleryValueToEntityAction($productMediaGalleryValueToEntityAction) |
||
319 | |||
320 | /** |
||
321 | * Return's the action with the product media gallery value to entity CRUD methods. |
||
322 | * |
||
323 | * @return \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction $productMediaGalleryAction The action with the product media gallery value to entity CRUD methods |
||
324 | */ |
||
325 | public function getProductMediaGalleryValueToEntityAction() |
||
329 | |||
330 | /** |
||
331 | * Set's the action with the product media gallery value video CRUD methods. |
||
332 | * |
||
333 | * @param \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction $productMediaGalleryValueVideoAction The action with the product media gallery value video CRUD methods |
||
334 | * |
||
335 | * @return void |
||
336 | */ |
||
337 | public function setProductMediaGalleryValueVideoAction($productMediaGalleryValueVideoAction) |
||
341 | |||
342 | /** |
||
343 | * Return's the action with the product media gallery value video CRUD methods. |
||
344 | * |
||
345 | * @return \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction The action with the product media gallery value video CRUD methods |
||
346 | */ |
||
347 | public function getProductMediaGalleryValueVideoAction() |
||
351 | |||
352 | /** |
||
353 | * Load's the product media gallery with the passed attribute ID + value. |
||
354 | * |
||
355 | * @param integer $attributeId The attribute ID of the product media gallery to load |
||
356 | * @param string $value The value of the product media gallery to load |
||
357 | * |
||
358 | * @return array The product media gallery |
||
359 | */ |
||
360 | public function loadProductMediaGallery($attributeId, $value) |
||
364 | |||
365 | /** |
||
366 | * Load's the product media gallery with the passed value/entity ID. |
||
367 | * |
||
368 | * @param integer $valueId The value ID of the product media gallery value to entity to load |
||
369 | * @param integer $entityId The entity ID of the product media gallery value to entity to load |
||
370 | * |
||
371 | * @return array The product media gallery |
||
372 | */ |
||
373 | public function loadProductMediaGalleryValueToEntity($valueId, $entityId) |
||
377 | |||
378 | /** |
||
379 | * Load's the product media gallery value with the passed value/store/parent ID. |
||
380 | * |
||
381 | * @param integer $valueId The value ID of the product media gallery value to load |
||
382 | * @param string $storeId The store ID of the product media gallery value to load |
||
383 | * @param string $entityId The entity ID of the parent product of the product media gallery value to load |
||
384 | * |
||
385 | * @return array The product media gallery value |
||
386 | */ |
||
387 | public function loadProductMediaGalleryValue($valueId, $storeId, $entityId) |
||
391 | |||
392 | /** |
||
393 | * Load's the product media gallery entities with the passed SKU. |
||
394 | * |
||
395 | * @param string $sku The SKU to load the media gallery entities for |
||
396 | * |
||
397 | * @return array The product media gallery entities |
||
398 | */ |
||
399 | public function getProductMediaGalleriesBySku($sku) |
||
403 | |||
404 | /** |
||
405 | * Persist's the passed product media gallery data and return's the ID. |
||
406 | * |
||
407 | * @param array $productMediaGallery The product media gallery data to persist |
||
408 | * @param string|null $name The name of the prepared statement that has to be executed |
||
409 | * |
||
410 | * @return string The ID of the persisted entity |
||
411 | */ |
||
412 | public function persistProductMediaGallery($productMediaGallery, $name = null) |
||
416 | |||
417 | /** |
||
418 | * Persist's the passed product media gallery value data. |
||
419 | * |
||
420 | * @param array $productMediaGalleryValue The product media gallery value data to persist |
||
421 | * @param string|null $name The name of the prepared statement that has to be executed |
||
422 | * |
||
423 | * @return void |
||
424 | */ |
||
425 | public function persistProductMediaGalleryValue($productMediaGalleryValue, $name = null) |
||
429 | |||
430 | /** |
||
431 | * Persist's the passed product media gallery value to entity data. |
||
432 | * |
||
433 | * @param array $productMediaGalleryValuetoEntity The product media gallery value to entity data to persist |
||
434 | * @param string|null $name The name of the prepared statement that has to be executed |
||
435 | * |
||
436 | * @return void |
||
437 | */ |
||
438 | public function persistProductMediaGalleryValueToEntity($productMediaGalleryValuetoEntity, $name = null) |
||
442 | |||
443 | /** |
||
444 | * Persist's the passed product media gallery value video data. |
||
445 | * |
||
446 | * @param array $productMediaGalleryValueVideo The product media gallery value video data to persist |
||
447 | * @param string|null $name The name of the prepared statement that has to be executed |
||
448 | * |
||
449 | * @return void |
||
450 | */ |
||
451 | public function persistProductMediaGalleryValueVideo($productMediaGalleryValueVideo, $name = null) |
||
455 | |||
456 | /** |
||
457 | * Delete's the passed product media gallery data. |
||
458 | * |
||
459 | * @param array $row The product media gallery data to be deleted |
||
460 | * @param string|null $name The name of the prepared statement that has to be executed |
||
461 | * |
||
462 | * @return string The ID of the persisted entity |
||
463 | */ |
||
464 | public function deleteProductMediaGallery(array $row, $name = null) |
||
468 | } |
||
469 |
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: