1 | <?php |
||
37 | class LinkObserver extends AbstractProductImportObserver |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * The product link processor instance. |
||
42 | * |
||
43 | * @var \TechDivision\Import\Product\Link\Services\ProductLinkProcessorInterface |
||
44 | */ |
||
45 | protected $productLinkProcessor; |
||
46 | |||
47 | /** |
||
48 | * Initialize the observer with the passed product link processor instance. |
||
49 | * |
||
50 | * @param \TechDivision\Import\Product\Link\Services\ProductLinkProcessorInterface $productLinkProcessor The product link processor instance |
||
51 | */ |
||
52 | public function __construct(ProductLinkProcessorInterface $productLinkProcessor) |
||
56 | |||
57 | /** |
||
58 | * Return's the product link processor instance. |
||
59 | * |
||
60 | * @return \TechDivision\Import\Product\Link\Services\ProductLinkProcessorInterface The product link processor instance |
||
61 | */ |
||
62 | protected function getProductLinkProcessor() |
||
66 | |||
67 | /** |
||
68 | * Process the observer's business logic. |
||
69 | * |
||
70 | * @return array The processed row |
||
71 | */ |
||
72 | protected function process() |
||
84 | |||
85 | /** |
||
86 | * Prepare the attributes of the entity that has to be persisted. |
||
87 | * |
||
88 | * @return array The prepared attributes |
||
89 | */ |
||
90 | protected function prepareAttributes() |
||
124 | |||
125 | /** |
||
126 | * Initialize the product link with the passed attributes and returns an instance. |
||
127 | * |
||
128 | * @param array $attr The product link attributes |
||
129 | * |
||
130 | * @return array The initialized product link |
||
131 | */ |
||
132 | protected function initializeProductLink(array $attr) |
||
148 | |||
149 | /** |
||
150 | * Load's the link with the passed product/linked product/link type ID. |
||
151 | * |
||
152 | * @param integer $productId The product ID of the link to load |
||
153 | * @param integer $linkedProductId The linked product ID of the link to load |
||
154 | * @param integer $linkTypeId The link type ID of the product to load |
||
155 | * |
||
156 | * @return array The link |
||
157 | */ |
||
158 | protected function loadProductLink($productId, $linkedProductId, $linkTypeId) |
||
162 | |||
163 | /** |
||
164 | * Temporary persist the last link ID. |
||
165 | * |
||
166 | * @param integer $lastLinkId The last link ID |
||
167 | * |
||
168 | * @return void |
||
169 | */ |
||
170 | protected function setLastLinkId($lastLinkId) |
||
174 | |||
175 | /** |
||
176 | * Persist's the passed product link data and return's the ID. |
||
177 | * |
||
178 | * @param array $productLink The product link data to persist |
||
179 | * |
||
180 | * @return string The ID of the persisted entity |
||
181 | */ |
||
182 | protected function persistProductLink($productLink) |
||
186 | |||
187 | /** |
||
188 | * Return the entity ID for the passed SKU. |
||
189 | * |
||
190 | * @param string $sku The SKU to return the entity ID for |
||
191 | * |
||
192 | * @return integer The mapped entity ID |
||
193 | * @throws \TechDivision\Import\Product\Exceptions\MapSkuToEntityIdException Is thrown if the SKU is not mapped yet |
||
194 | */ |
||
195 | protected function mapSkuToEntityId($sku) |
||
199 | |||
200 | /** |
||
201 | * Return the entity ID for the passed SKU. |
||
202 | * |
||
203 | * @param string $sku The SKU to return the entity ID for |
||
204 | * |
||
205 | * @return integer The mapped entity ID |
||
206 | * @throws \TechDivision\Import\Product\Exceptions\MapSkuToEntityIdException Is thrown if the SKU is not mapped yet |
||
207 | */ |
||
208 | protected function mapSku($sku) |
||
212 | |||
213 | /** |
||
214 | * Return the link type ID for the passed link type code. |
||
215 | * |
||
216 | * @param string $linkTypeCode The link type code to return the link type ID for |
||
217 | * |
||
218 | * @return integer The mapped link type ID |
||
219 | * @throws \TechDivision\Import\Product\Exceptions\MapLinkTypeCodeToIdException Is thrown if the link type code is not mapped yet |
||
220 | */ |
||
221 | protected function mapLinkTypeCodeToLinkTypeId($linkTypeCode) |
||
225 | |||
226 | /** |
||
227 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
228 | * |
||
229 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
230 | */ |
||
231 | protected function isDebugMode() |
||
235 | } |
||
236 |
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: