1 | <?php |
||
43 | class UrlKeyAndPathObserver extends AbstractCategoryImportObserver |
||
44 | { |
||
45 | |||
46 | /** |
||
47 | * The trait that provides string => URL key conversion functionality. |
||
48 | * |
||
49 | * @var \TechDivision\Import\Utils\Filter\UrlKeyFilterTrait |
||
50 | */ |
||
51 | use UrlKeyFilterTrait; |
||
52 | |||
53 | /** |
||
54 | * The URL key utility instance. |
||
55 | * |
||
56 | * @var \TechDivision\Import\Utils\UrlKeyUtilInterface |
||
57 | */ |
||
58 | protected $urlKeyUtil; |
||
59 | |||
60 | /** |
||
61 | * The category bunch processor instance. |
||
62 | * |
||
63 | * @var \TechDivision\Import\Category\Services\CategoryBunchProcessorInterface |
||
64 | */ |
||
65 | protected $categoryBunchProcessor; |
||
66 | |||
67 | /** |
||
68 | * Initialize the observer with the passed product bunch processor instance. |
||
69 | * |
||
70 | * @param \TechDivision\Import\Category\Services\CategoryBunchProcessorInterface $categoryBunchProcessor The category bunch processor instance |
||
71 | * @param \Zend\Filter\FilterInterface $convertLiteralUrlFilter The URL filter instance |
||
72 | * @param \TechDivision\Import\Utils\UrlKeyUtilInterface $urlKeyUtil The URL key utility instance |
||
73 | */ |
||
74 | public function __construct( |
||
85 | |||
86 | /** |
||
87 | * Process the observer's business logic. |
||
88 | * |
||
89 | * @return void |
||
90 | */ |
||
91 | protected function process() |
||
173 | |||
174 | /** |
||
175 | * Return the primary key member name. |
||
176 | * |
||
177 | * @return string The primary key member name |
||
178 | */ |
||
179 | protected function getPkMemberName() |
||
183 | |||
184 | /** |
||
185 | * Returns the category bunch processor instance. |
||
186 | * |
||
187 | * @return \TechDivision\Import\Category\Services\CategoryBunchProcessorInterface The category bunch processor instance |
||
188 | */ |
||
189 | protected function getCategoryBunchProcessor() |
||
193 | |||
194 | /** |
||
195 | * Returns the URL key utility instance. |
||
196 | * |
||
197 | * @return \TechDivision\Import\Utils\UrlKeyUtilInterface The URL key utility instance |
||
198 | */ |
||
199 | protected function getUrlKeyUtil() |
||
203 | |||
204 | /** |
||
205 | * Return's the category with the passed path. |
||
206 | * |
||
207 | * @param string $path The path of the category to return |
||
208 | * |
||
209 | * @return array The category |
||
210 | * @throws \Exception Is thrown, if the requested category is not available |
||
211 | */ |
||
212 | protected function getCategoryByPath($path) |
||
216 | |||
217 | /** |
||
218 | * Returns the category with the passed primary key and the attribute values for the passed store ID. |
||
219 | * |
||
220 | * @param string $pk The primary key of the category to return |
||
221 | * @param integer $storeId The store ID of the category values |
||
222 | * |
||
223 | * @return array|null The category data |
||
224 | */ |
||
225 | protected function getCategoryByPkAndStoreId($pk, $storeId) |
||
229 | |||
230 | /** |
||
231 | * Temporarily persist's the IDs of the passed category. |
||
232 | * |
||
233 | * @param array $category The category to temporarily persist the IDs for |
||
234 | * |
||
235 | * @return void |
||
236 | */ |
||
237 | protected function setIds(array $category) |
||
241 | |||
242 | /** |
||
243 | * Set's the ID of the category that has been created recently. |
||
244 | * |
||
245 | * @param string $lastEntityId The entity ID |
||
246 | * |
||
247 | * @return void |
||
248 | */ |
||
249 | protected function setLastEntityId($lastEntityId) |
||
253 | |||
254 | /** |
||
255 | * Return's the PK to of the product. |
||
256 | * |
||
257 | * @return integer The PK to create the relation with |
||
258 | */ |
||
259 | protected function getPrimaryKey() |
||
263 | |||
264 | /** |
||
265 | * Load's and return's the url_key with the passed primary ID. |
||
266 | * |
||
267 | * @param \TechDivision\Import\Subjects\UrlKeyAwareSubjectInterface $subject The subject to load the URL key |
||
268 | * @param int $primaryKeyId The ID from category |
||
269 | * |
||
270 | * @return string|null url_key or null |
||
271 | */ |
||
272 | protected function loadUrlKey(UrlKeyAwareSubjectInterface $subject, $primaryKeyId) |
||
276 | |||
277 | /** |
||
278 | * Make's the passed URL key unique by adding the next number to the end. |
||
279 | * |
||
280 | * @param \TechDivision\Import\Subjects\UrlKeyAwareSubjectInterface $subject The subject to make the URL key unique for |
||
281 | * @param string $urlKey The URL key to make unique |
||
282 | * |
||
283 | * @return string The unique URL key |
||
284 | */ |
||
285 | protected function makeUnique(UrlKeyAwareSubjectInterface $subject, $urlKey) |
||
289 | } |
||
290 |
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: