1 | <?php |
||
37 | class ProductLinkProcessor implements ProductLinkProcessorInterface |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * A PDO connection initialized with the values from the Doctrine EntityManager. |
||
42 | * |
||
43 | * @var \PDO |
||
44 | */ |
||
45 | protected $connection; |
||
46 | |||
47 | /** |
||
48 | * The repository to load product links. |
||
49 | * |
||
50 | * @var \TechDivision\Import\Product\Link\Repositories\\ProductLinkRepository |
||
51 | */ |
||
52 | protected $productLinkRepository; |
||
53 | |||
54 | /** |
||
55 | * The repository to load product link attribute integer attributes. |
||
56 | * |
||
57 | * @var \TechDivision\Import\Product\Link\Repositories\\ProductLinkAttributeIntRepository |
||
58 | */ |
||
59 | protected $productLinkAttributeIntRepository; |
||
60 | |||
61 | /** |
||
62 | * The action with the product link CRUD methods. |
||
63 | * |
||
64 | * @var \TechDivision\Import\Product\Link\Actions\ProductLinkAction |
||
65 | */ |
||
66 | protected $productLinkAction; |
||
67 | |||
68 | /** |
||
69 | * The action with the product link attribute integer CRUD methods. |
||
70 | * |
||
71 | * @var \TechDivision\Import\Product\Link\Actions\ProductLinkAttributeIntAction |
||
72 | */ |
||
73 | protected $productLinkAttributeIntAction; |
||
74 | |||
75 | /** |
||
76 | * Initialize the processor with the necessary assembler and repository instances. |
||
77 | * |
||
78 | * @param \PDO $connection The PDO connection to use |
||
79 | * @param \TechDivision\Import\Product\Link\Repositories\\ProductLinkRepository $productLinkRepository The product link repository to use |
||
80 | * @param \TechDivision\Import\Product\Link\Repositories\\ProductLinkAttributeIntRepository $productLinkAttributeIntRepository The product link attribute integer repository to use |
||
81 | * @param \TechDivision\Import\Product\Link\Actions\ProductLinkAction $productLinkAction The product link action to use |
||
82 | * @param \TechDivision\Import\Product\Link\Actions\ProductLinkAttributeIntAction $productLinkAttributeIntAction The product link attribute integer action to use |
||
83 | */ |
||
84 | public function __construct( |
||
97 | |||
98 | /** |
||
99 | * Set's the passed connection. |
||
100 | * |
||
101 | * @param \PDO $connection The connection to set |
||
102 | * |
||
103 | * @return void |
||
104 | */ |
||
105 | public function setConnection(\PDO $connection) |
||
109 | |||
110 | /** |
||
111 | * Return's the connection. |
||
112 | * |
||
113 | * @return \PDO The connection instance |
||
114 | */ |
||
115 | public function getConnection() |
||
119 | |||
120 | /** |
||
121 | * Turns off autocommit mode. While autocommit mode is turned off, changes made to the database via the PDO |
||
122 | * object instance are not committed until you end the transaction by calling ProductProcessor::commit(). |
||
123 | * Calling ProductProcessor::rollBack() will roll back all changes to the database and return the connection |
||
124 | * to autocommit mode. |
||
125 | * |
||
126 | * @return boolean Returns TRUE on success or FALSE on failure |
||
127 | * @link http://php.net/manual/en/pdo.begintransaction.php |
||
128 | */ |
||
129 | public function beginTransaction() |
||
133 | |||
134 | /** |
||
135 | * Commits a transaction, returning the database connection to autocommit mode until the next call to |
||
136 | * ProductProcessor::beginTransaction() starts a new transaction. |
||
137 | * |
||
138 | * @return boolean Returns TRUE on success or FALSE on failure |
||
139 | * @link http://php.net/manual/en/pdo.commit.php |
||
140 | */ |
||
141 | public function commit() |
||
145 | |||
146 | /** |
||
147 | * Rolls back the current transaction, as initiated by ProductProcessor::beginTransaction(). |
||
148 | * |
||
149 | * If the database was set to autocommit mode, this function will restore autocommit mode after it has |
||
150 | * rolled back the transaction. |
||
151 | * |
||
152 | * Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition |
||
153 | * language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit |
||
154 | * COMMIT will prevent you from rolling back any other changes within the transaction boundary. |
||
155 | * |
||
156 | * @return boolean Returns TRUE on success or FALSE on failure |
||
157 | * @link http://php.net/manual/en/pdo.rollback.php |
||
158 | */ |
||
159 | public function rollBack() |
||
163 | |||
164 | /** |
||
165 | * Set's the repository to load product links. |
||
166 | * |
||
167 | * @param \TechDivision\Import\Product\Link\Repositories\ProductLinkRepository $productLinkRepository The repository instance |
||
168 | * |
||
169 | * @return void |
||
170 | */ |
||
171 | public function setProductLinkRepository($productLinkRepository) |
||
175 | |||
176 | /** |
||
177 | * Return's the repository to load product links. |
||
178 | * |
||
179 | * @return \TechDivision\Import\Product\Link\Repositories\ProductLinkRepository The repository instance |
||
180 | */ |
||
181 | public function getProductLinkRepository() |
||
185 | |||
186 | /** |
||
187 | * Set's the repository to load product link attribute integer attributes. |
||
188 | * |
||
189 | * @param \TechDivision\Import\Product\Link\Repositories\ProductLinkAttributeIntRepository $productLinkAttributeIntRepository The repository instance |
||
190 | * |
||
191 | * @return void |
||
192 | */ |
||
193 | public function setProductLinkAttributeIntRepository($productLinkAttributeIntRepository) |
||
197 | |||
198 | /** |
||
199 | * Return's the repository to load product link attribute integer attributes. |
||
200 | * |
||
201 | * @return \TechDivision\Import\Product\Link\Repositories\ProductLinkAttributeIntRepository The repository instance |
||
202 | */ |
||
203 | public function getProductLinkAttributeIntRepository() |
||
207 | |||
208 | /** |
||
209 | * Set's the action with the product link CRUD methods. |
||
210 | * |
||
211 | * @param \TechDivision\Import\Product\Link\Actions\ProductLinkAction $productLinkAction The action with the product link CRUD methods |
||
212 | * |
||
213 | * @return void |
||
214 | */ |
||
215 | public function setProductLinkAction($productLinkAction) |
||
219 | |||
220 | /** |
||
221 | * Return's the action with the product link CRUD methods. |
||
222 | * |
||
223 | * @return \TechDivision\Import\Product\Link\Actions\ProductLinkGalleryAction The action with the product link CRUD methods |
||
224 | */ |
||
225 | public function getProductLinkAction() |
||
229 | |||
230 | /** |
||
231 | * Set's the action with the product link attribute integer CRUD methods. |
||
232 | * |
||
233 | * @param \TechDivision\Import\Product\Link\Actions\ProductLinkAttributeIntAction $productLinkAttributeIntAction The action with the product link attribute integer CRUD methods |
||
234 | * |
||
235 | * @return void |
||
236 | */ |
||
237 | public function setProductLinkAttributeIntAction($productLinkAttributeIntAction) |
||
241 | |||
242 | /** |
||
243 | * Return's the action with the product link attribute integer CRUD methods. |
||
244 | * |
||
245 | * @return \TechDivision\Import\Product\Link\Actions\ProductLinkAttributeIntAction The action with the product link attribute integer CRUD methods |
||
246 | */ |
||
247 | public function getProductLinkAttributeIntAction() |
||
251 | |||
252 | /** |
||
253 | * Load's the link with the passed product/linked product/link type ID. |
||
254 | * |
||
255 | * @param integer $productId The product ID of the link to load |
||
256 | * @param integer $linkedProductId The linked product ID of the link to load |
||
257 | * @param integer $linkTypeId The link type ID of the product to load |
||
258 | * |
||
259 | * @return array The link |
||
260 | */ |
||
261 | public function loadProductLink($productId, $linkedProductId, $linkTypeId) |
||
265 | |||
266 | /** |
||
267 | * Return's the product link attribute integer value with the passed product link attribute/link ID. |
||
268 | * |
||
269 | * @param integer $productLinkAttributeId The product link attribute ID of the attributes |
||
270 | * @param integer $linkId The link ID of the attribute |
||
271 | * |
||
272 | * @return array The product link attribute integer value |
||
273 | */ |
||
274 | public function loadProductLinkAttributeInt($productLinkAttributeId, $linkId) |
||
278 | |||
279 | /** |
||
280 | * Persist's the passed product link data and return's the ID. |
||
281 | * |
||
282 | * @param array $productLink The product link data to persist |
||
283 | * |
||
284 | * @return string The ID of the persisted entity |
||
285 | */ |
||
286 | public function persistProductLink($productLink) |
||
290 | |||
291 | /** |
||
292 | * Persist's the passed product link attribute integer data. |
||
293 | * |
||
294 | * @param array $productLinkAttributeInt The product link attribute integer data to persist |
||
295 | * |
||
296 | * @return string The ID of the persisted entity |
||
297 | */ |
||
298 | public function persistProductLinkAttributeInt($productLinkAttributeInt) |
||
302 | } |
||
303 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..