1 | <?php |
||
40 | class MediaSubject extends AbstractProductSubject implements FileUploadSubjectInterface |
||
41 | { |
||
42 | |||
43 | /** |
||
44 | * The trait that provides file upload functionality. |
||
45 | * |
||
46 | * @var \TechDivision\Import\Subjects\FileUploadTrait |
||
47 | */ |
||
48 | use FileUploadTrait; |
||
49 | |||
50 | /** |
||
51 | * The ID of the parent product to relate the variant with. |
||
52 | * |
||
53 | * @var integer |
||
54 | */ |
||
55 | protected $parentId; |
||
56 | |||
57 | /** |
||
58 | * The value ID of the created media gallery entry. |
||
59 | * |
||
60 | * @var integer |
||
61 | */ |
||
62 | protected $parentValueId; |
||
63 | |||
64 | /** |
||
65 | * The Magento installation directory. |
||
66 | * |
||
67 | * @var string |
||
68 | */ |
||
69 | protected $installationDir; |
||
70 | |||
71 | /** |
||
72 | * The position counter, if no position for the product media gallery value has been specified. |
||
73 | * |
||
74 | * @var integer |
||
75 | */ |
||
76 | protected $positionCounter = 1; |
||
77 | |||
78 | /** |
||
79 | * The available stores. |
||
80 | * |
||
81 | * @var array |
||
82 | */ |
||
83 | protected $stores = array(); |
||
84 | |||
85 | /** |
||
86 | * The mapping for the SKUs to the created entity IDs. |
||
87 | * |
||
88 | * @var array |
||
89 | */ |
||
90 | protected $skuEntityIdMapping = array(); |
||
91 | |||
92 | /** |
||
93 | * Intializes the previously loaded global data for exactly one variants. |
||
94 | * |
||
95 | * @return void |
||
96 | * @see \Importer\Csv\Actions\ProductImportAction::prepare() |
||
97 | */ |
||
98 | public function setUp() |
||
140 | |||
141 | /** |
||
142 | * Set's the ID of the parent product to relate the variant with. |
||
143 | * |
||
144 | * @param integer $parentId The ID of the parent product |
||
145 | * |
||
146 | * @return void |
||
147 | */ |
||
148 | public function setParentId($parentId) |
||
152 | |||
153 | /** |
||
154 | * Return's the ID of the parent product to relate the variant with. |
||
155 | * |
||
156 | * @return integer The ID of the parent product |
||
157 | */ |
||
158 | public function getParentId() |
||
162 | |||
163 | /** |
||
164 | * Set's the value ID of the created media gallery entry. |
||
165 | * |
||
166 | * @param integer $parentValueId The ID of the created media gallery entry |
||
167 | * |
||
168 | * @return void |
||
169 | */ |
||
170 | public function setParentValueId($parentValueId) |
||
174 | |||
175 | /** |
||
176 | * Return's the value ID of the created media gallery entry. |
||
177 | * |
||
178 | * @return integer The ID of the created media gallery entry |
||
179 | */ |
||
180 | public function getParentValueId() |
||
184 | |||
185 | /** |
||
186 | * Reset the position counter to 1. |
||
187 | * |
||
188 | * @return void |
||
189 | */ |
||
190 | public function resetPositionCounter() |
||
194 | |||
195 | /** |
||
196 | * Returns the acutal value of the position counter and raise's it by one. |
||
197 | * |
||
198 | * @return integer The actual value of the position counter |
||
199 | */ |
||
200 | public function raisePositionCounter() |
||
204 | |||
205 | /** |
||
206 | * Return the entity ID for the passed SKU. |
||
207 | * |
||
208 | * @param string $sku The SKU to return the entity ID for |
||
209 | * |
||
210 | * @return integer The mapped entity ID |
||
211 | * @throws \Exception Is thrown if the SKU is not mapped yet |
||
212 | */ |
||
213 | public function mapSkuToEntityId($sku) |
||
224 | |||
225 | /** |
||
226 | * Return's the store for the passed store code. |
||
227 | * |
||
228 | * @param string $storeCode The store code to return the store for |
||
229 | * |
||
230 | * @return array The requested store |
||
231 | * @throws \Exception Is thrown, if the requested store is not available |
||
232 | */ |
||
233 | public function getStoreByStoreCode($storeCode) |
||
244 | |||
245 | /** |
||
246 | * Load's the product media gallery with the passed attribute ID + value. |
||
247 | * |
||
248 | * @param integer $attributeId The attribute ID of the product media gallery to load |
||
249 | * @param string $value The value of the product media gallery to load |
||
250 | * |
||
251 | * @return array The product media gallery |
||
252 | */ |
||
253 | public function loadProductMediaGallery($attributeId, $value) |
||
257 | |||
258 | /** |
||
259 | * Load's the product media gallery with the passed value/entity ID. |
||
260 | * |
||
261 | * @param integer $valueId The value ID of the product media gallery value to entity to load |
||
262 | * @param integer $entityId The entity ID of the product media gallery value to entity to load |
||
263 | * |
||
264 | * @return array The product media gallery |
||
265 | */ |
||
266 | public function loadProductMediaGalleryValueToEntity($valueId, $entityId) |
||
270 | |||
271 | /** |
||
272 | * Load's the product media gallery value with the passed value/store/parent ID. |
||
273 | * |
||
274 | * @param integer $valueId The value ID of the product media gallery value to load |
||
275 | * @param string $storeId The store ID of the product media gallery value to load |
||
276 | * @param string $entityId The entity ID of the parent product of the product media gallery value to load |
||
277 | * |
||
278 | * @return array The product media gallery value |
||
279 | */ |
||
280 | public function loadProductMediaGalleryValue($valueId, $storeId, $entityId) |
||
284 | |||
285 | /** |
||
286 | * Persist's the passed product media gallery data and return's the ID. |
||
287 | * |
||
288 | * @param array $productMediaGallery The product media gallery data to persist |
||
289 | * |
||
290 | * @return string The ID of the persisted entity |
||
291 | */ |
||
292 | public function persistProductMediaGallery($productMediaGallery) |
||
296 | |||
297 | /** |
||
298 | * Persist's the passed product media gallery value data. |
||
299 | * |
||
300 | * @param array $productMediaGalleryValue The product media gallery value data to persist |
||
301 | * |
||
302 | * @return void |
||
303 | */ |
||
304 | public function persistProductMediaGalleryValue($productMediaGalleryValue) |
||
308 | |||
309 | /** |
||
310 | * Persist's the passed product media gallery value to entity data. |
||
311 | * |
||
312 | * @param array $productMediaGalleryValuetoEntity The product media gallery value to entity data to persist |
||
313 | * |
||
314 | * @return void |
||
315 | */ |
||
316 | public function persistProductMediaGalleryValueToEntity($productMediaGalleryValuetoEntity) |
||
320 | |||
321 | /** |
||
322 | * Persist's the passed product media gallery value video data. |
||
323 | * |
||
324 | * @param array $productMediaGalleryValueVideo The product media gallery value video data to persist |
||
325 | * |
||
326 | * @return void |
||
327 | */ |
||
328 | public function persistProductMediaGalleryValueVideo($productMediaGalleryValueVideo) |
||
332 | } |
||
333 |
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: