1 | <?php |
||
32 | class ProductMediaProcessor implements ProductMediaProcessorInterface |
||
33 | { |
||
34 | |||
35 | /** |
||
36 | * A PDO connection initialized with the values from the Doctrine EntityManager. |
||
37 | * |
||
38 | * @var \PDO |
||
39 | */ |
||
40 | protected $connection; |
||
41 | |||
42 | /** |
||
43 | * The repository to load product media galleries. |
||
44 | * |
||
45 | * @var \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryRepository |
||
46 | */ |
||
47 | protected $productMediaGalleryRepository; |
||
48 | |||
49 | /** |
||
50 | * The repository to load product media gallery to entities. |
||
51 | * |
||
52 | * @var \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueToEntityRepository |
||
53 | */ |
||
54 | protected $productMediaGalleryValueToEntityRepository; |
||
55 | |||
56 | /** |
||
57 | * The repository to load product media gallery values. |
||
58 | * |
||
59 | * @var \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueRepository |
||
60 | */ |
||
61 | protected $productMediaGalleryValueRepository; |
||
62 | |||
63 | /** |
||
64 | * The action with the product media gallery CRUD methods. |
||
65 | * |
||
66 | * @var \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction |
||
67 | */ |
||
68 | protected $productMediaGalleryAction; |
||
69 | |||
70 | /** |
||
71 | * The action with the product media gallery value CRUD methods. |
||
72 | * |
||
73 | * @var \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryValueAction |
||
74 | */ |
||
75 | protected $productMediaGalleryValueAction; |
||
76 | |||
77 | /** |
||
78 | * The action with the product media gallery value to entity CRUD methods. |
||
79 | * |
||
80 | * @var \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryValueToEntityAction |
||
81 | */ |
||
82 | protected $productMediaGalleryValueToEntityAction; |
||
83 | |||
84 | /** |
||
85 | * The action with the product media gallery video CRUD methods. |
||
86 | * |
||
87 | * @var \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryVideoAction |
||
88 | */ |
||
89 | protected $productMediaGalleryVideoAction; |
||
90 | |||
91 | /** |
||
92 | * Set's the passed connection. |
||
93 | * |
||
94 | * @param \PDO $connection The connection to set |
||
95 | * |
||
96 | * @return void |
||
97 | */ |
||
98 | public function setConnection(\PDO $connection) |
||
102 | |||
103 | /** |
||
104 | * Return's the connection. |
||
105 | * |
||
106 | * @return \PDO The connection instance |
||
107 | */ |
||
108 | public function getConnection() |
||
112 | |||
113 | /** |
||
114 | * Turns off autocommit mode. While autocommit mode is turned off, changes made to the database via the PDO |
||
115 | * object instance are not committed until you end the transaction by calling ProductProcessor::commit(). |
||
116 | * Calling ProductProcessor::rollBack() will roll back all changes to the database and return the connection |
||
117 | * to autocommit mode. |
||
118 | * |
||
119 | * @return boolean Returns TRUE on success or FALSE on failure |
||
120 | * @link http://php.net/manual/en/pdo.begintransaction.php |
||
121 | */ |
||
122 | public function beginTransaction() |
||
126 | |||
127 | /** |
||
128 | * Commits a transaction, returning the database connection to autocommit mode until the next call to |
||
129 | * ProductProcessor::beginTransaction() starts a new transaction. |
||
130 | * |
||
131 | * @return boolean Returns TRUE on success or FALSE on failure |
||
132 | * @link http://php.net/manual/en/pdo.commit.php |
||
133 | */ |
||
134 | public function commit() |
||
138 | |||
139 | /** |
||
140 | * Rolls back the current transaction, as initiated by ProductProcessor::beginTransaction(). |
||
141 | * |
||
142 | * If the database was set to autocommit mode, this function will restore autocommit mode after it has |
||
143 | * rolled back the transaction. |
||
144 | * |
||
145 | * Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition |
||
146 | * language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit |
||
147 | * COMMIT will prevent you from rolling back any other changes within the transaction boundary. |
||
148 | * |
||
149 | * @return boolean Returns TRUE on success or FALSE on failure |
||
150 | * @link http://php.net/manual/en/pdo.rollback.php |
||
151 | */ |
||
152 | public function rollBack() |
||
156 | |||
157 | /** |
||
158 | * Set's the repository to load product media gallery data. |
||
159 | * |
||
160 | * @param \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryRepository $productMediaGalleryRepository The repository instance |
||
161 | * |
||
162 | * @return void |
||
163 | */ |
||
164 | public function setProductMediaGalleryRepository($productMediaGalleryRepository) |
||
168 | |||
169 | /** |
||
170 | * Return's the repository to load product media gallery data. |
||
171 | * |
||
172 | * @return \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryRepository The repository instance |
||
173 | */ |
||
174 | public function getProductMediaGalleryRepository() |
||
178 | |||
179 | /** |
||
180 | * Set's the repository to load product media gallery value to entity data. |
||
181 | * |
||
182 | * @param \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueToEntityRepository $productMediaGalleryValueToEntityRepository The repository instance |
||
183 | * |
||
184 | * @return void |
||
185 | */ |
||
186 | public function setProductMediaGalleryValueToEntityRepository($productMediaGalleryValueToEntityRepository) |
||
190 | |||
191 | /** |
||
192 | * Return's the repository to load product media gallery value to entity data. |
||
193 | * |
||
194 | * @return \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueToEntityRepository The repository instance |
||
195 | */ |
||
196 | public function getProductMediaGalleryValueToEntityRepository() |
||
200 | |||
201 | /** |
||
202 | * Set's the repository to load product media gallery value data. |
||
203 | * |
||
204 | * @param \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueRepository $productMediaGalleryValueRepository The repository instance |
||
205 | * |
||
206 | * @return void |
||
207 | */ |
||
208 | public function setProductMediaGalleryValueRepository($productMediaGalleryValueRepository) |
||
212 | |||
213 | /** |
||
214 | * Return's the repository to load product media gallery value data. |
||
215 | * |
||
216 | * @return \TechDivision\Import\Product\Media\Repositories\ProductMediaGalleryValueRepository The repository instance |
||
217 | */ |
||
218 | public function getProductMediaGalleryValueRepository() |
||
222 | |||
223 | /** |
||
224 | * Set's the action with the product media gallery CRUD methods. |
||
225 | * |
||
226 | * @param \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction $productMediaGalleryAction The action with the product media gallery CRUD methods |
||
227 | * |
||
228 | * @return void |
||
229 | */ |
||
230 | public function setProductMediaGalleryAction($productMediaGalleryAction) |
||
234 | |||
235 | /** |
||
236 | * Return's the action with the product media gallery CRUD methods. |
||
237 | * |
||
238 | * @return \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction The action with the product media gallery CRUD methods |
||
239 | */ |
||
240 | public function getProductMediaGalleryAction() |
||
244 | |||
245 | /** |
||
246 | * Set's the action with the product media gallery valueCRUD methods. |
||
247 | * |
||
248 | * @param \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction $productMediaGalleryValueAction The action with the product media gallery value CRUD methods |
||
249 | * |
||
250 | * @return void |
||
251 | */ |
||
252 | public function setProductMediaGalleryValueAction($productMediaGalleryValueAction) |
||
256 | |||
257 | /** |
||
258 | * Return's the action with the product media gallery valueCRUD methods. |
||
259 | * |
||
260 | * @return \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction The action with the product media gallery value CRUD methods |
||
261 | */ |
||
262 | public function getProductMediaGalleryValueAction() |
||
266 | |||
267 | /** |
||
268 | * Set's the action with the product media gallery value to entity CRUD methods. |
||
269 | * |
||
270 | * @param \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction $productMediaGalleryValueToEntityAction The action with the product media gallery value to entity CRUD methods |
||
271 | * |
||
272 | * @return void |
||
273 | */ |
||
274 | public function setProductMediaGalleryValueToEntityAction($productMediaGalleryValueToEntityAction) |
||
278 | |||
279 | /** |
||
280 | * Return's the action with the product media gallery value to entity CRUD methods. |
||
281 | * |
||
282 | * @return \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction $productMediaGalleryAction The action with the product media gallery value to entity CRUD methods |
||
283 | */ |
||
284 | public function getProductMediaGalleryValueToEntityAction() |
||
288 | |||
289 | /** |
||
290 | * Set's the action with the product media gallery value video CRUD methods. |
||
291 | * |
||
292 | * @param \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction $productMediaGalleryValueVideoAction The action with the product media gallery value video CRUD methods |
||
293 | * |
||
294 | * @return void |
||
295 | */ |
||
296 | public function setProductMediaGalleryValueVideoAction($productMediaGalleryValueVideoAction) |
||
300 | |||
301 | /** |
||
302 | * Return's the action with the product media gallery value video CRUD methods. |
||
303 | * |
||
304 | * @return \TechDivision\Import\Product\Media\Actions\ProductMediaGalleryAction The action with the product media gallery value video CRUD methods |
||
305 | */ |
||
306 | public function getProductMediaGalleryValueVideoAction() |
||
310 | |||
311 | /** |
||
312 | * Load's the product media gallery with the passed attribute ID + value. |
||
313 | * |
||
314 | * @param integer $attributeId The attribute ID of the product media gallery to load |
||
315 | * @param string $value The value of the product media gallery to load |
||
316 | * |
||
317 | * @return array The product media gallery |
||
318 | */ |
||
319 | public function loadProductMediaGallery($attributeId, $value) |
||
323 | |||
324 | /** |
||
325 | * Load's the product media gallery with the passed value/entity ID. |
||
326 | * |
||
327 | * @param integer $valueId The value ID of the product media gallery value to entity to load |
||
328 | * @param integer $entityId The entity ID of the product media gallery value to entity to load |
||
329 | * |
||
330 | * @return array The product media gallery |
||
331 | */ |
||
332 | public function loadProductMediaGalleryValueToEntity($valueId, $entityId) |
||
336 | |||
337 | /** |
||
338 | * Load's the product media gallery value with the passed value/store/parent ID. |
||
339 | * |
||
340 | * @param integer $valueId The value ID of the product media gallery value to load |
||
341 | * @param string $storeId The store ID of the product media gallery value to load |
||
342 | * @param string $entityId The entity ID of the parent product of the product media gallery value to load |
||
343 | * |
||
344 | * @return array The product media gallery value |
||
345 | */ |
||
346 | public function loadProductMediaGalleryValue($valueId, $storeId, $entityId) |
||
350 | |||
351 | /** |
||
352 | * Persist's the passed product media gallery data and return's the ID. |
||
353 | * |
||
354 | * @param array $productMediaGallery The product media gallery data to persist |
||
355 | * @param string|null $name The name of the prepared statement that has to be executed |
||
356 | * |
||
357 | * @return string The ID of the persisted entity |
||
358 | */ |
||
359 | public function persistProductMediaGallery($productMediaGallery, $name = null) |
||
363 | |||
364 | /** |
||
365 | * Persist's the passed product media gallery value data. |
||
366 | * |
||
367 | * @param array $productMediaGalleryValue The product media gallery value data to persist |
||
368 | * @param string|null $name The name of the prepared statement that has to be executed |
||
369 | * |
||
370 | * @return void |
||
371 | */ |
||
372 | public function persistProductMediaGalleryValue($productMediaGalleryValue, $name = null) |
||
376 | |||
377 | /** |
||
378 | * Persist's the passed product media gallery value to entity data. |
||
379 | * |
||
380 | * @param array $productMediaGalleryValuetoEntity The product media gallery value to entity data to persist |
||
381 | * @param string|null $name The name of the prepared statement that has to be executed |
||
382 | * |
||
383 | * @return void |
||
384 | */ |
||
385 | public function persistProductMediaGalleryValueToEntity($productMediaGalleryValuetoEntity, $name = null) |
||
389 | |||
390 | /** |
||
391 | * Persist's the passed product media gallery value video data. |
||
392 | * |
||
393 | * @param array $productMediaGalleryValueVideo The product media gallery value video data to persist |
||
394 | * @param string|null $name The name of the prepared statement that has to be executed |
||
395 | * |
||
396 | * @return void |
||
397 | */ |
||
398 | public function persistProductMediaGalleryValueVideo($productMediaGalleryValueVideo, $name = null) |
||
402 | } |
||
403 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..