1 | <?php |
||
37 | class ProductWebsiteObserver extends AbstractProductImportObserver |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * The product bunch processor instance. |
||
42 | * |
||
43 | * @var \TechDivision\Import\Product\Services\ProductBunchProcessorInterface |
||
44 | */ |
||
45 | protected $productBunchProcessor; |
||
46 | |||
47 | /** |
||
48 | * Initialize the observer with the passed product bunch processor instance. |
||
49 | * |
||
50 | * @param \TechDivision\Import\Product\Services\ProductBunchProcessorInterface $productBunchProcessor The product bunch processor instance |
||
51 | */ |
||
52 | 1 | public function __construct(ProductBunchProcessorInterface $productBunchProcessor) |
|
56 | |||
57 | /** |
||
58 | * Return's the product bunch processor instance. |
||
59 | * |
||
60 | * @return \TechDivision\Import\Product\Services\ProductBunchProcessorInterface The product bunch processor instance |
||
61 | */ |
||
62 | protected function getProductBunchProcessor() |
||
66 | |||
67 | /** |
||
68 | * The actual website code that has to be processed. |
||
69 | * |
||
70 | * @var string |
||
71 | */ |
||
72 | protected $code; |
||
73 | |||
74 | /** |
||
75 | * Set's the actual website code that has to be processed. |
||
76 | * |
||
77 | * @param string $code The website code |
||
78 | * |
||
79 | * @return void |
||
80 | */ |
||
81 | protected function setCode($code) |
||
85 | |||
86 | /** |
||
87 | * Return's the webiste code that has to be processed. |
||
88 | * |
||
89 | * @return string The website code |
||
90 | */ |
||
91 | protected function getCode() |
||
95 | |||
96 | /** |
||
97 | * Process the observer's business logic. |
||
98 | * |
||
99 | * @return array The processed row |
||
100 | */ |
||
101 | 1 | protected function process() |
|
159 | |||
160 | /** |
||
161 | * Prepare the attributes of the entity that has to be persisted. |
||
162 | * |
||
163 | * @return array The prepared attributes |
||
164 | */ |
||
165 | protected function prepareAttributes() |
||
182 | |||
183 | /** |
||
184 | * Initialize the product website with the passed attributes and returns an instance. |
||
185 | * |
||
186 | * @param array $attr The product website attributes |
||
187 | * |
||
188 | * @return array The initialized product website |
||
189 | * @throws \RuntimeException Is thrown, if the attributes can not be initialized |
||
190 | */ |
||
191 | protected function initializeProductWebsite(array $attr) |
||
195 | |||
196 | /** |
||
197 | * Load's and return's the product website relations for the product with the passed SKU. |
||
198 | * |
||
199 | * @param string $sku The SKU to of the product to load the product website relations for |
||
200 | * |
||
201 | * @return array The product website relations |
||
202 | */ |
||
203 | protected function loadProductWebsitesBySku($sku) |
||
207 | |||
208 | /** |
||
209 | * Persist's the passed product website data. |
||
210 | * |
||
211 | * @param array $productWebsite The product website data to persist |
||
212 | * |
||
213 | * @return void |
||
214 | */ |
||
215 | protected function persistProductWebsite(array $productWebsite) |
||
219 | |||
220 | /** |
||
221 | * Delete's the passed product website data. |
||
222 | * |
||
223 | * @param array $productWebsite The product website data to delete |
||
224 | * |
||
225 | * @return void |
||
226 | */ |
||
227 | protected function deleteProductWebsite(array $productWebsite) |
||
231 | |||
232 | /** |
||
233 | * Return's the store website for the passed code. |
||
234 | * |
||
235 | * @param string $code The code of the store website to return the ID for |
||
236 | * |
||
237 | * @return integer The store website ID |
||
238 | */ |
||
239 | protected function getStoreWebsiteIdByCode($code) |
||
243 | } |
||
244 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.