1 | <?php |
||
39 | class ProductMediaProcessor implements ProductMediaProcessorInterface |
||
40 | { |
||
41 | |||
42 | /** |
||
43 | * A PDO connection initialized with the values from the Doctrine EntityManager. |
||
44 | * |
||
45 | * @var \TechDivision\Import\Connection\ConnectionInterface |
||
46 | */ |
||
47 | protected $connection; |
||
48 | |||
49 | /** |
||
50 | * The repository to load product media galleries. |
||
51 | * |
||
52 | * @var \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryRepositoryInterface |
||
53 | */ |
||
54 | protected $productMediaGalleryRepository; |
||
55 | |||
56 | /** |
||
57 | * The repository to load product media gallery to entities. |
||
58 | * |
||
59 | * @var \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueToEntityRepositoryInterface |
||
60 | */ |
||
61 | protected $productMediaGalleryValueToEntityRepository; |
||
62 | |||
63 | /** |
||
64 | * The repository to load product media gallery values. |
||
65 | * |
||
66 | * @var \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueRepositoryInterface |
||
67 | */ |
||
68 | protected $productMediaGalleryValueRepository; |
||
69 | |||
70 | /** |
||
71 | * The action with the product media gallery CRUD methods. |
||
72 | * |
||
73 | * @var \TechDivision\Import\Actions\ActionInterface |
||
74 | */ |
||
75 | protected $productMediaGalleryAction; |
||
76 | |||
77 | /** |
||
78 | * The action with the product media gallery value CRUD methods. |
||
79 | * |
||
80 | * @var \TechDivision\Import\Actions\ActionInterface |
||
81 | */ |
||
82 | protected $productMediaGalleryValueAction; |
||
83 | |||
84 | /** |
||
85 | * The action with the product media gallery value to entity CRUD methods. |
||
86 | * |
||
87 | * @var \TechDivision\Import\Actions\ActionInterface |
||
88 | */ |
||
89 | protected $productMediaGalleryValueToEntityAction; |
||
90 | |||
91 | /** |
||
92 | * The raw entity loader instance. |
||
93 | * |
||
94 | * @var \TechDivision\Import\Loaders\LoaderInterface |
||
95 | */ |
||
96 | protected $rawEntityLoader; |
||
97 | |||
98 | /** |
||
99 | * Initialize the processor with the necessary assembler and repository instances. |
||
100 | * |
||
101 | * @param \TechDivision\Import\Connection\ConnectionInterface $connection The connection to use |
||
102 | * @param \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryRepositoryInterface $productMediaGalleryRepository The product media gallery repository to use |
||
103 | * @param \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueRepositoryInterface $productMediaGalleryValueRepository The product media gallery value repository to use |
||
104 | * @param \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueToEntityRepositoryInterface $productMediaGalleryValueToEntityRepository The product media gallery value to entity repository to use |
||
105 | * @param \TechDivision\Import\Actions\ActionInterface $productMediaGalleryAction The product media gallery action to use |
||
106 | * @param \TechDivision\Import\Actions\ActionInterface $productMediaGalleryValueAction The product media gallery value action to use |
||
107 | * @param \TechDivision\Import\Actions\ActionInterface $productMediaGalleryValueToEntityAction The product media gallery value to entity action to use |
||
108 | * @param \TechDivision\Import\Loaders\LoaderInterface $rawEntityLoader The raw entity loader instance |
||
109 | */ |
||
110 | public function __construct( |
||
129 | |||
130 | /** |
||
131 | * Set's the raw entity loader instance. |
||
132 | * |
||
133 | * @param \TechDivision\Import\Loaders\LoaderInterface $rawEntityLoader The raw entity loader instance to set |
||
134 | * |
||
135 | * @return void |
||
136 | */ |
||
137 | public function setRawEntityLoader(LoaderInterface $rawEntityLoader) |
||
141 | |||
142 | /** |
||
143 | * Return's the raw entity loader instance. |
||
144 | * |
||
145 | * @return \TechDivision\Import\Loaders\LoaderInterface The raw entity loader instance |
||
146 | */ |
||
147 | public function getRawEntityLoader() |
||
151 | |||
152 | /** |
||
153 | * Set's the passed connection. |
||
154 | * |
||
155 | * @param \TechDivision\Import\Connection\ConnectionInterface $connection The connection to set |
||
156 | * |
||
157 | * @return void |
||
158 | */ |
||
159 | public function setConnection(ConnectionInterface $connection) |
||
163 | |||
164 | /** |
||
165 | * Return's the connection. |
||
166 | * |
||
167 | * @return \TechDivision\Import\Connection\ConnectionInterface The connection instance |
||
168 | */ |
||
169 | public function getConnection() |
||
173 | |||
174 | /** |
||
175 | * Turns off autocommit mode. While autocommit mode is turned off, changes made to the database via the PDO |
||
176 | * object instance are not committed until you end the transaction by calling ProductProcessor::commit(). |
||
177 | * Calling ProductProcessor::rollBack() will roll back all changes to the database and return the connection |
||
178 | * to autocommit mode. |
||
179 | * |
||
180 | * @return boolean Returns TRUE on success or FALSE on failure |
||
181 | * @link http://php.net/manual/en/pdo.begintransaction.php |
||
182 | */ |
||
183 | public function beginTransaction() |
||
187 | |||
188 | /** |
||
189 | * Commits a transaction, returning the database connection to autocommit mode until the next call to |
||
190 | * ProductProcessor::beginTransaction() starts a new transaction. |
||
191 | * |
||
192 | * @return boolean Returns TRUE on success or FALSE on failure |
||
193 | * @link http://php.net/manual/en/pdo.commit.php |
||
194 | */ |
||
195 | public function commit() |
||
199 | |||
200 | /** |
||
201 | * Rolls back the current transaction, as initiated by ProductProcessor::beginTransaction(). |
||
202 | * |
||
203 | * If the database was set to autocommit mode, this function will restore autocommit mode after it has |
||
204 | * rolled back the transaction. |
||
205 | * |
||
206 | * Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition |
||
207 | * language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit |
||
208 | * COMMIT will prevent you from rolling back any other changes within the transaction boundary. |
||
209 | * |
||
210 | * @return boolean Returns TRUE on success or FALSE on failure |
||
211 | * @link http://php.net/manual/en/pdo.rollback.php |
||
212 | */ |
||
213 | public function rollBack() |
||
217 | |||
218 | /** |
||
219 | * Set's the repository to load product media gallery data. |
||
220 | * |
||
221 | * @param \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryRepositoryInterface $productMediaGalleryRepository The repository instance |
||
222 | * |
||
223 | * @return void |
||
224 | */ |
||
225 | public function setProductMediaGalleryRepository(ProductMediaGalleryRepositoryInterface $productMediaGalleryRepository) |
||
229 | |||
230 | /** |
||
231 | * Return's the repository to load product media gallery data. |
||
232 | * |
||
233 | * @return \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryRepositoryInterface The repository instance |
||
234 | */ |
||
235 | public function getProductMediaGalleryRepository() |
||
239 | |||
240 | /** |
||
241 | * Set's the repository to load product media gallery value to entity data. |
||
242 | * |
||
243 | * @param \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueToEntityRepositoryInterface $productMediaGalleryValueToEntityRepository The repository instance |
||
244 | * |
||
245 | * @return void |
||
246 | */ |
||
247 | public function setProductMediaGalleryValueToEntityRepository(ProductMediaGalleryValueToEntityRepositoryInterface $productMediaGalleryValueToEntityRepository) |
||
251 | |||
252 | /** |
||
253 | * Return's the repository to load product media gallery value to entity data. |
||
254 | * |
||
255 | * @return \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueToEntityRepositoryInterface The repository instance |
||
256 | */ |
||
257 | public function getProductMediaGalleryValueToEntityRepository() |
||
261 | |||
262 | /** |
||
263 | * Set's the repository to load product media gallery value data. |
||
264 | * |
||
265 | * @param \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueRepositoryInterface $productMediaGalleryValueRepository The repository instance |
||
266 | * |
||
267 | * @return void |
||
268 | */ |
||
269 | public function setProductMediaGalleryValueRepository(ProductMediaGalleryValueRepositoryInterface $productMediaGalleryValueRepository) |
||
273 | |||
274 | /** |
||
275 | * Return's the repository to load product media gallery value data. |
||
276 | * |
||
277 | * @return \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueRepositoryInterface The repository instance |
||
278 | */ |
||
279 | public function getProductMediaGalleryValueRepository() |
||
283 | |||
284 | /** |
||
285 | * Set's the action with the product media gallery CRUD methods. |
||
286 | * |
||
287 | * @param \TechDivision\Import\Actions\ActionInterface $productMediaGalleryAction The action with the product media gallery CRUD methods |
||
288 | * |
||
289 | * @return void |
||
290 | */ |
||
291 | public function setProductMediaGalleryAction(ActionInterface $productMediaGalleryAction) |
||
295 | |||
296 | /** |
||
297 | * Return's the action with the product media gallery CRUD methods. |
||
298 | * |
||
299 | * @return \TechDivision\Import\Actions\ActionInterface The action with the product media gallery CRUD methods |
||
300 | */ |
||
301 | public function getProductMediaGalleryAction() |
||
305 | |||
306 | /** |
||
307 | * Set's the action with the product media gallery valueCRUD methods. |
||
308 | * |
||
309 | * @param \TechDivision\Import\Actions\ActionInterface $productMediaGalleryValueAction The action with the product media gallery value CRUD methods |
||
310 | * |
||
311 | * @return void |
||
312 | */ |
||
313 | public function setProductMediaGalleryValueAction(ActionInterface $productMediaGalleryValueAction) |
||
317 | |||
318 | /** |
||
319 | * Return's the action with the product media gallery valueCRUD methods. |
||
320 | * |
||
321 | * @return \TechDivision\Import\Actions\ActionInterface The action with the product media gallery value CRUD methods |
||
322 | */ |
||
323 | public function getProductMediaGalleryValueAction() |
||
327 | |||
328 | /** |
||
329 | * Set's the action with the product media gallery value to entity CRUD methods. |
||
330 | * |
||
331 | * @param \TechDivision\Import\Actions\ActionInterface $productMediaGalleryValueToEntityAction The action with the product media gallery value to entity CRUD methods |
||
332 | * |
||
333 | * @return void |
||
334 | */ |
||
335 | public function setProductMediaGalleryValueToEntityAction(ActionInterface $productMediaGalleryValueToEntityAction) |
||
339 | |||
340 | /** |
||
341 | * Return's the action with the product media gallery value to entity CRUD methods. |
||
342 | * |
||
343 | * @return \TechDivision\Import\Actions\ActionInterface $productMediaGalleryAction The action with the product media gallery value to entity CRUD methods |
||
344 | */ |
||
345 | public function getProductMediaGalleryValueToEntityAction() |
||
349 | |||
350 | /** |
||
351 | * Load's and return's a raw entity without primary key but the mandatory members only and nulled values. |
||
352 | * |
||
353 | * @param string $entityTypeCode The entity type code to return the raw entity for |
||
354 | * @param array $data An array with data that will be used to initialize the raw entity with |
||
355 | * |
||
356 | * @return array The initialized entity |
||
357 | */ |
||
358 | public function loadRawEntity($entityTypeCode, array $data = array()) |
||
362 | |||
363 | /** |
||
364 | * Load's the product media gallery with the passed attribute ID + value. |
||
365 | * |
||
366 | * @param integer $attributeId The attribute ID of the product media gallery to load |
||
367 | * @param string $value The value of the product media gallery to load |
||
368 | * |
||
369 | * @return array The product media gallery |
||
370 | */ |
||
371 | public function loadProductMediaGallery($attributeId, $value) |
||
375 | |||
376 | /** |
||
377 | * Load's the product media gallery with the passed value/entity ID. |
||
378 | * |
||
379 | * @param integer $valueId The value ID of the product media gallery value to entity to load |
||
380 | * @param integer $entityId The entity ID of the product media gallery value to entity to load |
||
381 | * |
||
382 | * @return array The product media gallery |
||
383 | */ |
||
384 | public function loadProductMediaGalleryValueToEntity($valueId, $entityId) |
||
388 | |||
389 | /** |
||
390 | * Load's the product media gallery value with the passed value/store/parent ID. |
||
391 | * |
||
392 | * @param integer $valueId The value ID of the product media gallery value to load |
||
393 | * @param string $storeId The store ID of the product media gallery value to load |
||
394 | * @param string $entityId The entity ID of the parent product of the product media gallery value to load |
||
395 | * |
||
396 | * @return array The product media gallery value |
||
397 | */ |
||
398 | public function loadProductMediaGalleryValue($valueId, $storeId, $entityId) |
||
402 | |||
403 | /** |
||
404 | * Load's the product media gallery entities with the passed SKU. |
||
405 | * |
||
406 | * @param string $sku The SKU to load the media gallery entities for |
||
407 | * |
||
408 | * @return array The product media gallery entities |
||
409 | */ |
||
410 | public function getProductMediaGalleriesBySku($sku) |
||
414 | |||
415 | /** |
||
416 | * Persist's the passed product media gallery data and return's the ID. |
||
417 | * |
||
418 | * @param array $productMediaGallery The product media gallery data to persist |
||
419 | * @param string|null $name The name of the prepared statement that has to be executed |
||
420 | * |
||
421 | * @return string The ID of the persisted entity |
||
422 | */ |
||
423 | public function persistProductMediaGallery($productMediaGallery, $name = null) |
||
427 | |||
428 | /** |
||
429 | * Persist's the passed product media gallery value data. |
||
430 | * |
||
431 | * @param array $productMediaGalleryValue The product media gallery value data to persist |
||
432 | * @param string|null $name The name of the prepared statement that has to be executed |
||
433 | * |
||
434 | * @return void |
||
435 | */ |
||
436 | public function persistProductMediaGalleryValue($productMediaGalleryValue, $name = null) |
||
440 | |||
441 | /** |
||
442 | * Persist's the passed product media gallery value to entity data. |
||
443 | * |
||
444 | * @param array $productMediaGalleryValuetoEntity The product media gallery value to entity data to persist |
||
445 | * @param string|null $name The name of the prepared statement that has to be executed |
||
446 | * |
||
447 | * @return void |
||
448 | */ |
||
449 | public function persistProductMediaGalleryValueToEntity($productMediaGalleryValuetoEntity, $name = null) |
||
453 | |||
454 | /** |
||
455 | * Delete's the passed product media gallery data. |
||
456 | * |
||
457 | * @param array $row The product media gallery data to be deleted |
||
458 | * @param string|null $name The name of the prepared statement that has to be executed |
||
459 | * |
||
460 | * @return string The ID of the persisted entity |
||
461 | */ |
||
462 | public function deleteProductMediaGallery(array $row, $name = null) |
||
466 | } |
||
467 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.