|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* TechDivision\Import\Product\Bundle\Services\ProductProcessor |
|
5
|
|
|
* |
|
6
|
|
|
* NOTICE OF LICENSE |
|
7
|
|
|
* |
|
8
|
|
|
* This source file is subject to the Open Software License (OSL 3.0) |
|
9
|
|
|
* that is available through the world-wide-web at this URL: |
|
10
|
|
|
* http://opensource.org/licenses/osl-3.0.php |
|
11
|
|
|
* |
|
12
|
|
|
* PHP version 5 |
|
13
|
|
|
* |
|
14
|
|
|
* @author Tim Wagner <[email protected]> |
|
15
|
|
|
* @copyright 2016 TechDivision GmbH <[email protected]> |
|
16
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
|
17
|
|
|
* @link https://github.com/techdivision/import-product-bundle |
|
18
|
|
|
* @link http://www.techdivision.com |
|
19
|
|
|
*/ |
|
20
|
|
|
|
|
21
|
|
|
namespace TechDivision\Import\Product\Bundle\Services; |
|
22
|
|
|
|
|
23
|
|
|
use TechDivision\Import\Product\Bundle\Repositories\BundleOptionRepository; |
|
24
|
|
|
use TechDivision\Import\Product\Bundle\Repositories\BundleOptionValueRepository; |
|
25
|
|
|
use TechDivision\Import\Product\Bundle\Repositories\BundleSelectionRepository; |
|
26
|
|
|
use TechDivision\Import\Product\Bundle\Repositories\BundleSelectionPriceRepository; |
|
27
|
|
|
use TechDivision\Import\Product\Bundle\Actions\ProductBundleOptionAction; |
|
28
|
|
|
use TechDivision\Import\Product\Bundle\Actions\ProductBundleOptionValueAction; |
|
29
|
|
|
use TechDivision\Import\Product\Bundle\Actions\ProductBundleSelectionAction; |
|
30
|
|
|
use TechDivision\Import\Product\Bundle\Actions\ProductBundleSelectionPriceAction; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* A SLSB providing methods to load product data using a PDO connection. |
|
34
|
|
|
* |
|
35
|
|
|
* @author Tim Wagner <[email protected]> |
|
36
|
|
|
* @copyright 2016 TechDivision GmbH <[email protected]> |
|
37
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
|
38
|
|
|
* @link https://github.com/techdivision/import-product-bundle |
|
39
|
|
|
* @link http://www.techdivision.com |
|
40
|
|
|
*/ |
|
41
|
|
|
class ProductBundleProcessor implements ProductBundleProcessorInterface |
|
42
|
|
|
{ |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* A PDO connection initialized with the values from the Doctrine EntityManager. |
|
46
|
|
|
* |
|
47
|
|
|
* @var \PDO |
|
48
|
|
|
*/ |
|
49
|
|
|
protected $connection; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* The action for product bundle option CRUD methods. |
|
53
|
|
|
* |
|
54
|
|
|
* @var \TechDivision\Import\Product\Bundle\Actions\ProductBundleOptionAction |
|
55
|
|
|
*/ |
|
56
|
|
|
protected $productBundleOptionAction; |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* The action for product bundle option value CRUD methods. |
|
60
|
|
|
* |
|
61
|
|
|
* @var \TechDivision\Import\Product\Bundle\Actions\ProductBundleOptionValueAction |
|
62
|
|
|
*/ |
|
63
|
|
|
protected $productBundleOptionValueAction; |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* The action for product bundle selection CRUD methods. |
|
67
|
|
|
* |
|
68
|
|
|
* @var \TechDivision\Import\Product\Bundle\Actions\ProductBundleSelectionAction |
|
69
|
|
|
*/ |
|
70
|
|
|
protected $productBundleSelectionAction; |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* The action for product bundle selection price CRUD methods. |
|
74
|
|
|
* |
|
75
|
|
|
* @var \TechDivision\Import\Product\Bundle\Actions\ProductBundleSelectionPriceAction |
|
76
|
|
|
*/ |
|
77
|
|
|
protected $productBundleSelectionPriceAction; |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* The repository to load bundle option data. |
|
81
|
|
|
* |
|
82
|
|
|
* @var \TechDivision\Import\Product\Bundle\Respository\BundleOptionRepository |
|
83
|
|
|
*/ |
|
84
|
|
|
protected $bundleOptionRespository; |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* The repository to load bundle option value data. |
|
88
|
|
|
* |
|
89
|
|
|
* @var \TechDivision\Import\Product\Bundle\Respository\BundleOptionValueRepository |
|
90
|
|
|
*/ |
|
91
|
|
|
protected $bundleOptionValueRespository; |
|
92
|
|
|
|
|
93
|
|
|
/** |
|
94
|
|
|
* The repository to load bundle selection data. |
|
95
|
|
|
* |
|
96
|
|
|
* @var \TechDivision\Import\Product\Bundle\Respository\BundleSelectionRepository |
|
97
|
|
|
*/ |
|
98
|
|
|
protected $bundleSelectionRespository; |
|
99
|
|
|
|
|
100
|
|
|
/** |
|
101
|
|
|
* The repository to load bundle selection price data. |
|
102
|
|
|
* |
|
103
|
|
|
* @var \TechDivision\Import\Product\Bundle\Respository\BundleSelectionPriceRepository |
|
104
|
|
|
*/ |
|
105
|
|
|
protected $bundleSelectionPriceRespository; |
|
106
|
|
|
|
|
107
|
|
|
/** |
|
108
|
|
|
* Initialize the processor with the necessary assembler and repository instances. |
|
109
|
|
|
* |
|
110
|
|
|
* @param \PDO $connection The PDO connection to use |
|
111
|
|
|
* @param \TechDivision\Import\Product\Bundle\Respository\BundleOptionRepository $bundleOptionRepository The bundle option repository to use |
|
112
|
|
|
* @param \TechDivision\Import\Product\Bundle\Respository\BundleOptionValueRepository $bundleOptionValueRepository The bundle option value repository to use |
|
113
|
|
|
* @param \TechDivision\Import\Product\Bundle\Respository\BundleSelectionRepository $bundleSelectionRepository The bundle selection repository to use |
|
114
|
|
|
* @param \TechDivision\Import\Product\Bundle\Respository\BundleSelectionPriceRepository $bundleSelectionPriceRepository The bundle selection price repository to use |
|
115
|
|
|
* @param \TechDivision\Import\Product\Bundle\Actions\ProductBundleOptionAction $productBundleOptionAction The product bundle option action to use |
|
116
|
|
|
* @param \TechDivision\Import\Product\Bundle\Actions\ProductBundleOptionValueAction $productBundleOptionValueAction The product bundle option value action to use |
|
117
|
|
|
* @param \TechDivision\Import\Product\Bundle\Actions\ProductBundleSelectionAction $productBundleSelectionAction The product bundle selection action to use |
|
118
|
|
|
* @param \TechDivision\Import\Product\Bundle\Actions\ProductBundleSelectionPriceAction $productBundleSelectionPriceAction The product bundle selection price action to use |
|
119
|
|
|
*/ |
|
120
|
|
|
public function __construct( |
|
121
|
|
|
\PDO $connection, |
|
122
|
|
|
BundleOptionRepository $bundleOptionRepository, |
|
123
|
|
|
BundleOptionValueRepository $bundleOptionValueRepository, |
|
124
|
|
|
BundleSelectionRepository $bundleSelectionRepository, |
|
125
|
|
|
BundleSelectionPriceRepository $bundleSelectionPriceRepository, |
|
126
|
|
|
ProductBundleOptionAction $productBundleOptionAction, |
|
127
|
|
|
ProductBundleOptionValueAction $productBundleOptionValueAction, |
|
128
|
|
|
ProductBundleSelectionAction $productBundleSelectionAction, |
|
129
|
|
|
ProductBundleSelectionPriceAction $productBundleSelectionPriceAction |
|
130
|
|
|
) { |
|
131
|
|
|
$this->setConnection($connection); |
|
132
|
|
|
$this->setBundleOptionRepository($bundleOptionRepository); |
|
|
|
|
|
|
133
|
|
|
$this->setBundleOptionValueRepository($bundleOptionValueRepository); |
|
|
|
|
|
|
134
|
|
|
$this->setBundleSelectionRepository($bundleSelectionRepository); |
|
|
|
|
|
|
135
|
|
|
$this->setBundleSelectionPriceRepository($bundleSelectionPriceRepository); |
|
|
|
|
|
|
136
|
|
|
$this->setProductBundleOptionAction($productBundleOptionAction); |
|
137
|
|
|
$this->setProductBundleOptionValueAction($productBundleOptionValueAction); |
|
138
|
|
|
$this->setProductBundleSelectionAction($productBundleSelectionAction); |
|
139
|
|
|
$this->setProductBundleSelectionPriceAction($productBundleSelectionPriceAction); |
|
140
|
|
|
} |
|
141
|
|
|
|
|
142
|
|
|
/** |
|
143
|
|
|
* Set's the passed connection. |
|
144
|
|
|
* |
|
145
|
|
|
* @param \PDO $connection The connection to set |
|
146
|
|
|
* |
|
147
|
|
|
* @return void |
|
148
|
|
|
*/ |
|
149
|
|
|
public function setConnection(\PDO $connection) |
|
150
|
|
|
{ |
|
151
|
|
|
$this->connection = $connection; |
|
152
|
|
|
} |
|
153
|
|
|
|
|
154
|
|
|
/** |
|
155
|
|
|
* Return's the connection. |
|
156
|
|
|
* |
|
157
|
|
|
* @return \PDO The connection instance |
|
158
|
|
|
*/ |
|
159
|
|
|
public function getConnection() |
|
160
|
|
|
{ |
|
161
|
|
|
return $this->connection; |
|
162
|
|
|
} |
|
163
|
|
|
|
|
164
|
|
|
/** |
|
165
|
|
|
* Turns off autocommit mode. While autocommit mode is turned off, changes made to the database via the PDO |
|
166
|
|
|
* object instance are not committed until you end the transaction by calling ProductProcessor::commit(). |
|
167
|
|
|
* Calling ProductProcessor::rollBack() will roll back all changes to the database and return the connection |
|
168
|
|
|
* to autocommit mode. |
|
169
|
|
|
* |
|
170
|
|
|
* @return boolean Returns TRUE on success or FALSE on failure |
|
171
|
|
|
* @link http://php.net/manual/en/pdo.begintransaction.php |
|
172
|
|
|
*/ |
|
173
|
|
|
public function beginTransaction() |
|
174
|
|
|
{ |
|
175
|
|
|
return $this->connection->beginTransaction(); |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
/** |
|
179
|
|
|
* Commits a transaction, returning the database connection to autocommit mode until the next call to |
|
180
|
|
|
* ProductProcessor::beginTransaction() starts a new transaction. |
|
181
|
|
|
* |
|
182
|
|
|
* @return boolean Returns TRUE on success or FALSE on failure |
|
183
|
|
|
* @link http://php.net/manual/en/pdo.commit.php |
|
184
|
|
|
*/ |
|
185
|
|
|
public function commit() |
|
186
|
|
|
{ |
|
187
|
|
|
return $this->connection->commit(); |
|
188
|
|
|
} |
|
189
|
|
|
|
|
190
|
|
|
/** |
|
191
|
|
|
* Rolls back the current transaction, as initiated by ProductProcessor::beginTransaction(). |
|
192
|
|
|
* |
|
193
|
|
|
* If the database was set to autocommit mode, this function will restore autocommit mode after it has |
|
194
|
|
|
* rolled back the transaction. |
|
195
|
|
|
* |
|
196
|
|
|
* Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition |
|
197
|
|
|
* language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit |
|
198
|
|
|
* COMMIT will prevent you from rolling back any other changes within the transaction boundary. |
|
199
|
|
|
* |
|
200
|
|
|
* @return boolean Returns TRUE on success or FALSE on failure |
|
201
|
|
|
* @link http://php.net/manual/en/pdo.rollback.php |
|
202
|
|
|
*/ |
|
203
|
|
|
public function rollBack() |
|
204
|
|
|
{ |
|
205
|
|
|
return $this->connection->rollBack(); |
|
206
|
|
|
} |
|
207
|
|
|
|
|
208
|
|
|
/** |
|
209
|
|
|
* Set's the action with the product bundle option CRUD methods. |
|
210
|
|
|
* |
|
211
|
|
|
* @param \TechDivision\Import\Product\Bundle\Actions\ProductBundleOptionAction $productBundleOptionAction The action with the product bundle option CRUD methods |
|
212
|
|
|
* |
|
213
|
|
|
* @return void |
|
214
|
|
|
*/ |
|
215
|
|
|
public function setProductBundleOptionAction($productBundleOptionAction) |
|
216
|
|
|
{ |
|
217
|
|
|
$this->productBundleOptionAction = $productBundleOptionAction; |
|
218
|
|
|
} |
|
219
|
|
|
|
|
220
|
|
|
/** |
|
221
|
|
|
* Return's the action with the product bundle option CRUD methods. |
|
222
|
|
|
* |
|
223
|
|
|
* @return \TechDivision\Import\Product\Bundle\Actions\ProductBundleOptionAction The action instance |
|
224
|
|
|
*/ |
|
225
|
|
|
public function getProductBundleOptionAction() |
|
226
|
|
|
{ |
|
227
|
|
|
return $this->productBundleOptionAction; |
|
228
|
|
|
} |
|
229
|
|
|
|
|
230
|
|
|
/** |
|
231
|
|
|
* Set's the action with the product bundle option value CRUD methods. |
|
232
|
|
|
* |
|
233
|
|
|
* @param \TechDivision\Import\Product\Bundle\Actions\ProductBundleOptionValueAction $productBundleOptionValueAction The action with the product bundle option value CRUD methods |
|
234
|
|
|
* |
|
235
|
|
|
* @return void |
|
236
|
|
|
*/ |
|
237
|
|
|
public function setProductBundleOptionValueAction($productBundleOptionValueAction) |
|
238
|
|
|
{ |
|
239
|
|
|
$this->productBundleOptionValueAction = $productBundleOptionValueAction; |
|
240
|
|
|
} |
|
241
|
|
|
|
|
242
|
|
|
/** |
|
243
|
|
|
* Return's the action with the product bundle option value CRUD methods. |
|
244
|
|
|
* |
|
245
|
|
|
* @return \TechDivision\Import\Product\Bundle\Actions\ProductBundleOptionValueAction The action instance |
|
246
|
|
|
*/ |
|
247
|
|
|
public function getProductBundleOptionValueAction() |
|
248
|
|
|
{ |
|
249
|
|
|
return $this->productBundleOptionValueAction; |
|
250
|
|
|
} |
|
251
|
|
|
|
|
252
|
|
|
/** |
|
253
|
|
|
* Set's the action with the product bundle selection CRUD methods. |
|
254
|
|
|
* |
|
255
|
|
|
* @param \TechDivision\Import\Product\Bundle\Actions\ProductBundleSelectionAction $productBundleSelectionAction The action with the product bundle selection CRUD methods |
|
256
|
|
|
* |
|
257
|
|
|
* @return void |
|
258
|
|
|
*/ |
|
259
|
|
|
public function setProductBundleSelectionAction($productBundleSelectionAction) |
|
260
|
|
|
{ |
|
261
|
|
|
$this->productBundleSelectionAction = $productBundleSelectionAction; |
|
262
|
|
|
} |
|
263
|
|
|
|
|
264
|
|
|
/** |
|
265
|
|
|
* Return's the action with the product bundle selection CRUD methods. |
|
266
|
|
|
* |
|
267
|
|
|
* @return \TechDivision\Import\Product\Bundle\Actions\ProductBundleSelectionAction The action instance |
|
268
|
|
|
*/ |
|
269
|
|
|
public function getProductBundleSelectionAction() |
|
270
|
|
|
{ |
|
271
|
|
|
return $this->productBundleSelectionAction; |
|
272
|
|
|
} |
|
273
|
|
|
|
|
274
|
|
|
/** |
|
275
|
|
|
* Set's the action with the product bundle selection price CRUD methods. |
|
276
|
|
|
* |
|
277
|
|
|
* @param \TechDivision\Import\Product\Bundle\Actions\ProductBundleSelectionPriceAction $productBundleSelectionPriceAction The action with the product bundle selection price CRUD methods |
|
278
|
|
|
* |
|
279
|
|
|
* @return void |
|
280
|
|
|
*/ |
|
281
|
|
|
public function setProductBundleSelectionPriceAction($productBundleSelectionPriceAction) |
|
282
|
|
|
{ |
|
283
|
|
|
$this->productBundleSelectionPriceAction = $productBundleSelectionPriceAction; |
|
284
|
|
|
} |
|
285
|
|
|
|
|
286
|
|
|
/** |
|
287
|
|
|
* Return's the action with the product bundle selection price CRUD methods. |
|
288
|
|
|
* |
|
289
|
|
|
* @return \TechDivision\Import\Product\Bundle\Actions\ProductBundleSelectionPriceAction The action instance |
|
290
|
|
|
*/ |
|
291
|
|
|
public function getProductBundleSelectionPriceAction() |
|
292
|
|
|
{ |
|
293
|
|
|
return $this->productBundleSelectionPriceAction; |
|
294
|
|
|
} |
|
295
|
|
|
|
|
296
|
|
|
/** |
|
297
|
|
|
* Set's the repository to load bundle option data. |
|
298
|
|
|
* |
|
299
|
|
|
* @param \TechDivision\Import\Product\Bundle\Repository\BundleOptionRespository $bundleOptionRespository The repository instance |
|
300
|
|
|
* |
|
301
|
|
|
* @return void |
|
302
|
|
|
*/ |
|
303
|
|
|
public function setBundleOptionRepository($bundleOptionRespository) |
|
304
|
|
|
{ |
|
305
|
|
|
$this->bundleOptionRespository = $bundleOptionRespository; |
|
|
|
|
|
|
306
|
|
|
} |
|
307
|
|
|
|
|
308
|
|
|
/** |
|
309
|
|
|
* Return's the respository to load bundle option data. |
|
310
|
|
|
* |
|
311
|
|
|
* @return \TechDivision\Import\Product\Bundle\Repository\BundleOptionRespository The repository instance |
|
312
|
|
|
*/ |
|
313
|
|
|
public function getBundleOptionRepository() |
|
314
|
|
|
{ |
|
315
|
|
|
return $this->bundleOptionRespository; |
|
|
|
|
|
|
316
|
|
|
} |
|
317
|
|
|
|
|
318
|
|
|
/** |
|
319
|
|
|
* Set's the repository to load bundle option value data. |
|
320
|
|
|
* |
|
321
|
|
|
* @param \TechDivision\Import\Product\Bundle\Repository\BundleOptionValueRespository $bundleOptionValueRespository The repository instance |
|
322
|
|
|
* |
|
323
|
|
|
* @return void |
|
324
|
|
|
*/ |
|
325
|
|
|
public function setBundleOptionValueRepository($bundleOptionValueRespository) |
|
326
|
|
|
{ |
|
327
|
|
|
$this->bundleOptionValueRespository = $bundleOptionValueRespository; |
|
|
|
|
|
|
328
|
|
|
} |
|
329
|
|
|
|
|
330
|
|
|
/** |
|
331
|
|
|
* Return's the respository to load bundle option value data. |
|
332
|
|
|
* |
|
333
|
|
|
* @return \TechDivision\Import\Product\Bundle\Repository\BundleOptionValueRespository The repository instance |
|
334
|
|
|
*/ |
|
335
|
|
|
public function getBundleOptionValueRepository() |
|
336
|
|
|
{ |
|
337
|
|
|
return $this->bundleOptionValueRespository; |
|
|
|
|
|
|
338
|
|
|
} |
|
339
|
|
|
|
|
340
|
|
|
/** |
|
341
|
|
|
* Set's the repository to load bundle selection data. |
|
342
|
|
|
* |
|
343
|
|
|
* @param \TechDivision\Import\Product\Bundle\Repository\BundleSelectionRespository $bundleSelectionRespository The repository instance |
|
344
|
|
|
* |
|
345
|
|
|
* @return void |
|
346
|
|
|
*/ |
|
347
|
|
|
public function setBundleSelectionRepository($bundleSelectionRespository) |
|
348
|
|
|
{ |
|
349
|
|
|
$this->bundleSelectionRespository = $bundleSelectionRespository; |
|
|
|
|
|
|
350
|
|
|
} |
|
351
|
|
|
|
|
352
|
|
|
/** |
|
353
|
|
|
* Return's the respository to load bundle selection data. |
|
354
|
|
|
* |
|
355
|
|
|
* @return \TechDivision\Import\Product\Bundle\Repository\BundleSelectionRespository The repository instance |
|
356
|
|
|
*/ |
|
357
|
|
|
public function getBundleSelectionRepository() |
|
358
|
|
|
{ |
|
359
|
|
|
return $this->bundleSelectionRespository; |
|
360
|
|
|
} |
|
361
|
|
|
|
|
362
|
|
|
/** |
|
363
|
|
|
* Set's the repository to load bundle selection price data. |
|
364
|
|
|
* |
|
365
|
|
|
* @param \TechDivision\Import\Product\Bundle\Repository\BundleSelectionPriceRespository $bundleSelectionPriceRespository The repository instance |
|
366
|
|
|
* |
|
367
|
|
|
* @return void |
|
368
|
|
|
*/ |
|
369
|
|
|
public function setBundleSelectionPriceRepository($bundleSelectionPriceRespository) |
|
370
|
|
|
{ |
|
371
|
|
|
$this->bundleSelectionPriceRespository = $bundleSelectionPriceRespository; |
|
|
|
|
|
|
372
|
|
|
} |
|
373
|
|
|
|
|
374
|
|
|
/** |
|
375
|
|
|
* Return's the respository to load bundle selection price data. |
|
376
|
|
|
* |
|
377
|
|
|
* @return \TechDivision\Import\Product\Bundle\Repository\BundleSelectionPriceRespository The repository instance |
|
378
|
|
|
*/ |
|
379
|
|
|
public function getBundleSelectionPriceRepository() |
|
380
|
|
|
{ |
|
381
|
|
|
return $this->bundleSelectionPriceRespository; |
|
382
|
|
|
} |
|
383
|
|
|
|
|
384
|
|
|
/** |
|
385
|
|
|
* Load's the bundle option with the passed name, store + parent ID. |
|
386
|
|
|
* |
|
387
|
|
|
* @param string $title The title of the bundle option to be returned |
|
388
|
|
|
* @param integer $storeId The store ID of the bundle option to be returned |
|
389
|
|
|
* @param integer $parentId The entity of the product the bundle option is related with |
|
390
|
|
|
* |
|
391
|
|
|
* @return array The bundle option |
|
392
|
|
|
*/ |
|
393
|
|
|
public function loadBundleOption($title, $storeId, $parentId) |
|
394
|
|
|
{ |
|
395
|
|
|
return $this->getBundleOptionRepository()->findOneByNameAndStoreIdAndParentId($title, $storeId, $parentId); |
|
396
|
|
|
} |
|
397
|
|
|
|
|
398
|
|
|
/** |
|
399
|
|
|
* Load's the bundle option value with the passed name, store + parent ID. |
|
400
|
|
|
* |
|
401
|
|
|
* @param string $title The title of the bundle option value to be returned |
|
402
|
|
|
* @param integer $storeId The store ID of the bundle option value to be returned |
|
403
|
|
|
* @param integer $parentId The entity of the product the bundle option value is related with |
|
404
|
|
|
* |
|
405
|
|
|
* @return array The bundle option |
|
406
|
|
|
*/ |
|
407
|
|
|
public function loadBundleOptionValue($title, $storeId, $parentId) |
|
408
|
|
|
{ |
|
409
|
|
|
return $this->getBundleOptionValueRepository()->findOneByNameAndStoreIdAndParentId($title, $storeId, $parentId); |
|
410
|
|
|
} |
|
411
|
|
|
|
|
412
|
|
|
/** |
|
413
|
|
|
* Load's the bundle selection value with the passed option/product/parent product ID. |
|
414
|
|
|
* |
|
415
|
|
|
* @param integer $optionId The option ID of the bundle selection to be returned |
|
416
|
|
|
* @param integer $productId The product ID of the bundle selection to be returned |
|
417
|
|
|
* @param integer $parentProductId The parent product ID of the bundle selection to be returned |
|
418
|
|
|
* |
|
419
|
|
|
* @return array The bundle selection |
|
420
|
|
|
*/ |
|
421
|
|
|
public function loadBundleSelection($optionId, $productId, $parentProductId) |
|
422
|
|
|
{ |
|
423
|
|
|
return $this->getBundleSelectionRepository()->findOneByOptionIdAndProductIdAndParentProductId($optionId, $productId, $parentProductId); |
|
424
|
|
|
} |
|
425
|
|
|
|
|
426
|
|
|
/** |
|
427
|
|
|
* Load's the bundle selection price with the passed selection/website ID. |
|
428
|
|
|
* |
|
429
|
|
|
* @param integer $selectionId The selection ID of the bundle selection price to be returned |
|
430
|
|
|
* @param integer $websiteId The website ID of the bundle selection price to be returned |
|
431
|
|
|
* |
|
432
|
|
|
* @return array The bundle selection price |
|
433
|
|
|
*/ |
|
434
|
|
|
public function loadBundleSelectionPrice($selectionId, $websiteId) |
|
435
|
|
|
{ |
|
436
|
|
|
return $this->getBundleSelectionPriceRepository()->findOneByOptionIdAndProductIdAndParentProductId($selectionId, $websiteId); |
|
437
|
|
|
} |
|
438
|
|
|
|
|
439
|
|
|
/** |
|
440
|
|
|
* Persist's the passed product bundle option data and return's the ID. |
|
441
|
|
|
* |
|
442
|
|
|
* @param array $productBundleOption The product bundle option data to persist |
|
443
|
|
|
* |
|
444
|
|
|
* @return string The ID of the persisted entity |
|
445
|
|
|
*/ |
|
446
|
|
|
public function persistProductBundleOption($productBundleOption) |
|
447
|
|
|
{ |
|
448
|
|
|
return $this->getProductBundleOptionAction()->persist($productBundleOption); |
|
449
|
|
|
} |
|
450
|
|
|
|
|
451
|
|
|
/** |
|
452
|
|
|
* Persist's the passed product bundle option value data. |
|
453
|
|
|
* |
|
454
|
|
|
* @param array $productBundleOptionValue The product bundle option value data to persist |
|
455
|
|
|
* |
|
456
|
|
|
* @return void |
|
457
|
|
|
*/ |
|
458
|
|
|
public function persistProductBundleOptionValue($productBundleOptionValue) |
|
459
|
|
|
{ |
|
460
|
|
|
$this->getProductBundleOptionValueAction()->persist($productBundleOptionValue); |
|
461
|
|
|
} |
|
462
|
|
|
|
|
463
|
|
|
/** |
|
464
|
|
|
* Persist's the passed product bundle selection data and return's the ID. |
|
465
|
|
|
* |
|
466
|
|
|
* @param array $productBundleSelection The product bundle selection data to persist |
|
467
|
|
|
* |
|
468
|
|
|
* @return string The ID of the persisted entity |
|
469
|
|
|
*/ |
|
470
|
|
|
public function persistProductBundleSelection($productBundleSelection) |
|
471
|
|
|
{ |
|
472
|
|
|
return $this->getProductBundleSelectionAction()->persist($productBundleSelection); |
|
473
|
|
|
} |
|
474
|
|
|
|
|
475
|
|
|
/** |
|
476
|
|
|
* Persist's the passed product bundle selection price data and return's the ID. |
|
477
|
|
|
* |
|
478
|
|
|
* @param array $productBundleSelectionPrice The product bundle selection price data to persist |
|
479
|
|
|
* |
|
480
|
|
|
* @return void |
|
481
|
|
|
*/ |
|
482
|
|
|
public function persistProductBundleSelectionPrice($productBundleSelectionPrice) |
|
483
|
|
|
{ |
|
484
|
|
|
return $this->getProductBundleSelectionPriceAction()->persist($productBundleSelectionPrice); |
|
485
|
|
|
} |
|
486
|
|
|
} |
|
487
|
|
|
|
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: