1 | <?php |
||
38 | class MediaGalleryValueObserver extends AbstractProductImportObserver |
||
39 | { |
||
40 | |||
41 | /** |
||
42 | * The product media processor instance. |
||
43 | * |
||
44 | * @var \TechDivision\Import\Product\Media\Services\ProductMediaProcessorInterface |
||
45 | */ |
||
46 | protected $productMediaProcessor; |
||
47 | |||
48 | /** |
||
49 | * Initialize the observer with the passed product media processor instance. |
||
50 | * |
||
51 | * @param \TechDivision\Import\Product\Media\Services\ProductMediaProcessorInterface $productMediaProcessor The product media processor instance |
||
52 | */ |
||
53 | public function __construct(ProductMediaProcessorInterface $productMediaProcessor) |
||
57 | |||
58 | /** |
||
59 | * Return's the product media processor instance. |
||
60 | * |
||
61 | * @return \TechDivision\Import\Product\Media\Services\ProductMediaProcessorInterface The product media processor instance |
||
62 | */ |
||
63 | protected function getProductMediaProcessor() |
||
67 | |||
68 | /** |
||
69 | * Process the observer's business logic. |
||
70 | * |
||
71 | * @return array The processed row |
||
72 | */ |
||
73 | protected function process() |
||
80 | |||
81 | /** |
||
82 | * Prepare the product media gallery value that has to be persisted. |
||
83 | * |
||
84 | * @return array The prepared product media gallery value attributes |
||
85 | */ |
||
86 | protected function prepareAttributes() |
||
121 | |||
122 | /** |
||
123 | * Initialize the product media gallery value with the passed attributes and returns an instance. |
||
124 | * |
||
125 | * @param array $attr The product media gallery value attributes |
||
126 | * |
||
127 | * @return array The initialized product media gallery value |
||
128 | */ |
||
129 | protected function initializeProductMediaGalleryValue(array $attr) |
||
133 | |||
134 | /** |
||
135 | * Return's the store ID of the actual row, or of the default store |
||
136 | * if no store view code is set in the CSV file. |
||
137 | * |
||
138 | * @param string|null $default The default store view code to use, if no store view code is set in the CSV file |
||
139 | * |
||
140 | * @return integer The ID of the actual store |
||
141 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
142 | */ |
||
143 | protected function getRowStoreId($default = null) |
||
147 | |||
148 | /** |
||
149 | * Map's the passed SKU of the parent product to it's PK. |
||
150 | * |
||
151 | * @param string $parentSku The SKU of the parent product |
||
152 | * |
||
153 | * @return integer The primary key used to create relations |
||
154 | */ |
||
155 | protected function mapParentSku($parentSku) |
||
159 | |||
160 | /** |
||
161 | * Return the entity ID for the passed SKU. |
||
162 | * |
||
163 | * @param string $sku The SKU to return the entity ID for |
||
164 | * |
||
165 | * @return integer The mapped entity ID |
||
166 | * @throws \Exception Is thrown if the SKU is not mapped yet |
||
167 | */ |
||
168 | protected function mapSkuToEntityId($sku) |
||
172 | |||
173 | /** |
||
174 | * Return's the value ID of the created media gallery entry. |
||
175 | * |
||
176 | * @return integer The ID of the created media gallery entry |
||
177 | */ |
||
178 | protected function getParentValueId() |
||
182 | |||
183 | /** |
||
184 | * Return's the store for the passed store code. |
||
185 | * |
||
186 | * @param string $storeCode The store code to return the store for |
||
187 | * |
||
188 | * @return array The requested store |
||
189 | * @throws \Exception Is thrown, if the requested store is not available |
||
190 | */ |
||
191 | protected function getStoreByStoreCode($storeCode) |
||
195 | |||
196 | /** |
||
197 | * Returns the acutal value of the position counter and raise's it by one. |
||
198 | * |
||
199 | * @return integer The actual value of the position counter |
||
200 | */ |
||
201 | protected function raisePositionCounter() |
||
205 | |||
206 | /** |
||
207 | * Persist's the passed product media gallery value data. |
||
208 | * |
||
209 | * @param array $productMediaGalleryValue The product media gallery value data to persist |
||
210 | * |
||
211 | * @return void |
||
212 | */ |
||
213 | protected function persistProductMediaGalleryValue($productMediaGalleryValue) |
||
217 | } |
||
218 |
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: