1 | <?php |
||
38 | class LinkObserver extends AbstractProductImportObserver |
||
39 | { |
||
40 | |||
41 | /** |
||
42 | * The product link processor instance. |
||
43 | * |
||
44 | * @var \TechDivision\Import\Product\Link\Services\ProductLinkProcessorInterface |
||
45 | */ |
||
46 | protected $productLinkProcessor; |
||
47 | |||
48 | /** |
||
49 | * Initialize the observer with the passed product link processor instance. |
||
50 | * |
||
51 | * @param \TechDivision\Import\Product\Link\Services\ProductLinkProcessorInterface $productLinkProcessor The product link processor instance |
||
52 | */ |
||
53 | public function __construct(ProductLinkProcessorInterface $productLinkProcessor) |
||
57 | |||
58 | /** |
||
59 | * Return's the product link processor instance. |
||
60 | * |
||
61 | * @return \TechDivision\Import\Product\Bundle\Services\ProductBundleProcessorInterface The product link processor instance |
||
62 | */ |
||
63 | protected function getProductLinkProcessor() |
||
67 | |||
68 | /** |
||
69 | * Process the observer's business logic. |
||
70 | * |
||
71 | * @return array The processed row |
||
72 | */ |
||
73 | protected function process() |
||
85 | |||
86 | /** |
||
87 | * Prepare the attributes of the entity that has to be persisted. |
||
88 | * |
||
89 | * @return array The prepared attributes |
||
90 | */ |
||
91 | protected function prepareAttributes() |
||
132 | |||
133 | /** |
||
134 | * Initialize the product link with the passed attributes and returns an instance. |
||
135 | * |
||
136 | * @param array $attr The product link attributes |
||
137 | * |
||
138 | * @return array The initialized product link |
||
139 | */ |
||
140 | protected function initializeProductLink(array $attr) |
||
144 | |||
145 | /** |
||
146 | * Temporary persist the last link ID. |
||
147 | * |
||
148 | * @param integer $lastLinkId The last link ID |
||
149 | * |
||
150 | * @return void |
||
151 | */ |
||
152 | protected function setLastLinkId($lastLinkId) |
||
156 | |||
157 | /** |
||
158 | * Persist's the passed product link data and return's the ID. |
||
159 | * |
||
160 | * @param array $productLink The product link data to persist |
||
161 | * |
||
162 | * @return string The ID of the persisted entity |
||
163 | */ |
||
164 | protected function persistProductLink($productLink) |
||
168 | |||
169 | /** |
||
170 | * Return the entity ID for the passed SKU. |
||
171 | * |
||
172 | * @param string $sku The SKU to return the entity ID for |
||
173 | * |
||
174 | * @return integer The mapped entity ID |
||
175 | * @throws \TechDivision\Import\Product\Link\Exceptions\MapSkuToEntityIdException Is thrown if the SKU is not mapped yet |
||
176 | */ |
||
177 | protected function mapSkuToEntityId($sku) |
||
181 | |||
182 | /** |
||
183 | * Return the entity ID for the passed SKU. |
||
184 | * |
||
185 | * @param string $sku The SKU to return the entity ID for |
||
186 | * |
||
187 | * @return integer The mapped entity ID |
||
188 | * @throws \TechDivision\Import\Product\Link\Exceptions\MapSkuToEntityIdException Is thrown if the SKU is not mapped yet |
||
189 | */ |
||
190 | protected function mapSku($sku) |
||
194 | |||
195 | /** |
||
196 | * Return the link type ID for the passed link type code. |
||
197 | * |
||
198 | * @param string $linkTypeCode The link type code to return the link type ID for |
||
199 | * |
||
200 | * @return integer The mapped link type ID |
||
201 | * @throws \TechDivision\Import\Product\Link\Exceptions\MapLinkTypeCodeToIdException Is thrown if the link type code is not mapped yet |
||
202 | */ |
||
203 | protected function mapLinkTypeCodeToLinkTypeId($linkTypeCode) |
||
207 | |||
208 | /** |
||
209 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
210 | * |
||
211 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
212 | */ |
||
213 | protected function isDebugMode() |
||
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: