Completed
Push — 22.x ( d7197a )
by Tim
03:35
created

ProductBundleProcessor::loadBundleSelection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 2
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\Loaders\LoaderInterface;
24
use TechDivision\Import\Actions\ActionInterface;
25
use TechDivision\Import\Connection\ConnectionInterface;
26
use TechDivision\Import\Product\Repositories\ProductRelationRepositoryInterface;
27
use TechDivision\Import\Product\Bundle\Repositories\BundleOptionRepositoryInterface;
28
use TechDivision\Import\Product\Bundle\Repositories\BundleOptionValueRepositoryInterface;
29
use TechDivision\Import\Product\Bundle\Repositories\BundleSelectionRepositoryInterface;
30
use TechDivision\Import\Product\Bundle\Repositories\BundleSelectionPriceRepositoryInterface;
31
32
/**
33
 * The product bundle processor implementation.
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 \TechDivision\Import\Connection\ConnectionInterface
48
     */
49
    protected $connection;
50
51
    /**
52
     * The action for product bundle option CRUD methods.
53
     *
54
     * @var \TechDivision\Import\Actions\ActionInterface
55
     */
56
    protected $productBundleOptionAction;
57
58
    /**
59
     * The action for product bundle option value CRUD methods.
60
     *
61
     * @var \TechDivision\Import\Actions\ActionInterface
62
     */
63
    protected $productBundleOptionValueAction;
64
65
    /**
66
     * The action for product bundle selection CRUD methods.
67
     *
68
     * @var \TechDivision\Import\Actions\ActionInterface
69
     */
70
    protected $productBundleSelectionAction;
71
72
    /**
73
     * The action for product bundle selection price CRUD methods.
74
     *
75
     * @var \TechDivision\Import\Actions\ActionInterface
76
     */
77
    protected $productBundleSelectionPriceAction;
78
79
    /**
80
     * The action for product relation CRUD methods.
81
     *
82
     * @var \TechDivision\Import\Actions\ActionInterface
83
     */
84
    protected $productRelationAction;
85
86
    /**
87
     * The repository to load bundle option data.
88
     *
89
     * @var \TechDivision\Import\Product\Bundle\Repositories\BundleOptionRepositoryInterface
90
     */
91
    protected $bundleOptionRespository;
92
93
    /**
94
     * The repository to load bundle option value data.
95
     *
96
     * @var \TechDivision\Import\Product\Bundle\Repositories\BundleOptionValueRepositoryInterface
97
     */
98
    protected $bundleOptionValueRespository;
99
100
    /**
101
     * The repository to load bundle selection data.
102
     *
103
     * @var \TechDivision\Import\Product\Bundle\Repositories\BundleSelectionRepositoryInterface
104
     */
105
    protected $bundleSelectionRespository;
106
107
    /**
108
     * The repository to load bundle selection price data.
109
     *
110
     * @var \TechDivision\Import\Product\Bundle\Repositories\BundleSelectionPriceRepositoryInterface
111
     */
112
    protected $bundleSelectionPriceRespository;
113
114
    /**
115
     * The repository to access product relations.
116
     *
117
     * @var \TechDivision\Import\Product\Repositories\ProductRelationRepositoryInterface
118
     */
119
    protected $productRelationRepository;
120
121
    /**
122
     * The raw entity loader instance.
123
     *
124
     * @var \TechDivision\Import\Loaders\LoaderInterface
125
     */
126
    protected $rawEntityLoader;
127
128
    /**
129
     * Initialize the processor with the necessary assembler and repository instances.
130
     *
131
     * @param \TechDivision\Import\Connection\ConnectionInterface                                      $connection                        The connection to use
132
     * @param \TechDivision\Import\Product\Bundle\Repositories\BundleOptionRepositoryInterface         $bundleOptionRepository            The bundle option repository to use
133
     * @param \TechDivision\Import\Product\Bundle\Repositories\BundleOptionValueRepositoryInterface    $bundleOptionValueRepository       The bundle option value repository to use
134
     * @param \TechDivision\Import\Product\Bundle\Repositories\BundleSelectionRepositoryInterface      $bundleSelectionRepository         The bundle selection repository to use
135
     * @param \TechDivision\Import\Product\Bundle\Repositories\BundleSelectionPriceRepositoryInterface $bundleSelectionPriceRepository    The bundle selection price repository to use
136
     * @param \TechDivision\Import\Product\Repositories\ProductRelationRepositoryInterface             $productRelationRepository         The product relation repository to use
137
     * @param \TechDivision\Import\Actions\ActionInterface                                             $productBundleOptionAction         The product bundle option action to use
138
     * @param \TechDivision\Import\Actions\ActionInterface                                             $productBundleOptionValueAction    The product bundle option value action to use
139
     * @param \TechDivision\Import\Actions\ActionInterface                                             $productBundleSelectionAction      The product bundle selection action to use
140
     * @param \TechDivision\Import\Actions\ActionInterface                                             $productBundleSelectionPriceAction The product bundle selection price action to use
141
     * @param \TechDivision\Import\Actions\ActionInterface                                             $productRelationAction             The product relation action to use
142
     * @param \TechDivision\Import\Loaders\LoaderInterface                                             $rawEntityLoader                   The raw entity loader instance
143
     */
144
    public function __construct(
145
        ConnectionInterface $connection,
146
        BundleOptionRepositoryInterface $bundleOptionRepository,
147
        BundleOptionValueRepositoryInterface $bundleOptionValueRepository,
148
        BundleSelectionRepositoryInterface $bundleSelectionRepository,
149
        BundleSelectionPriceRepositoryInterface $bundleSelectionPriceRepository,
150
        ProductRelationRepositoryInterface $productRelationRepository,
151
        ActionInterface $productBundleOptionAction,
152
        ActionInterface $productBundleOptionValueAction,
153
        ActionInterface $productBundleSelectionAction,
154
        ActionInterface $productBundleSelectionPriceAction,
155
        ActionInterface $productRelationAction,
156
        LoaderInterface $rawEntityLoader
157
    ) {
158
        $this->setConnection($connection);
159
        $this->setBundleOptionRepository($bundleOptionRepository);
160
        $this->setBundleOptionValueRepository($bundleOptionValueRepository);
161
        $this->setBundleSelectionRepository($bundleSelectionRepository);
162
        $this->setBundleSelectionPriceRepository($bundleSelectionPriceRepository);
163
        $this->setProductRelationRepository($productRelationRepository);
164
        $this->setProductBundleOptionAction($productBundleOptionAction);
165
        $this->setProductBundleOptionValueAction($productBundleOptionValueAction);
166
        $this->setProductBundleSelectionAction($productBundleSelectionAction);
167
        $this->setProductBundleSelectionPriceAction($productBundleSelectionPriceAction);
168
        $this->setProductRelationAction($productRelationAction);
169
        $this->setRawEntityLoader($rawEntityLoader);
170
    }
171
172
    /**
173
     * Set's the raw entity loader instance.
174
     *
175
     * @param \TechDivision\Import\Loaders\LoaderInterface $rawEntityLoader The raw entity loader instance to set
176
     *
177
     * @return void
178
     */
179
    public function setRawEntityLoader(LoaderInterface $rawEntityLoader)
180
    {
181
        $this->rawEntityLoader = $rawEntityLoader;
182
    }
183
184
    /**
185
     * Return's the raw entity loader instance.
186
     *
187
     * @return \TechDivision\Import\Loaders\LoaderInterface The raw entity loader instance
188
     */
189
    public function getRawEntityLoader()
190
    {
191
        return $this->rawEntityLoader;
192
    }
193
194
    /**
195
     * Set's the passed connection.
196
     *
197
     * @param \TechDivision\Import\Connection\ConnectionInterface $connection The connection to set
198
     *
199
     * @return void
200
     */
201
    public function setConnection(ConnectionInterface $connection)
202
    {
203
        $this->connection = $connection;
204
    }
205
206
    /**
207
     * Return's the connection.
208
     *
209
     * @return \TechDivision\Import\Connection\ConnectionInterface The connection instance
210
     */
211
    public function getConnection()
212
    {
213
        return $this->connection;
214
    }
215
216
    /**
217
     * Turns off autocommit mode. While autocommit mode is turned off, changes made to the database via the PDO
218
     * object instance are not committed until you end the transaction by calling ProductProcessor::commit().
219
     * Calling ProductProcessor::rollBack() will roll back all changes to the database and return the connection
220
     * to autocommit mode.
221
     *
222
     * @return boolean Returns TRUE on success or FALSE on failure
223
     * @link http://php.net/manual/en/pdo.begintransaction.php
224
     */
225
    public function beginTransaction()
226
    {
227
        return $this->connection->beginTransaction();
228
    }
229
230
    /**
231
     * Commits a transaction, returning the database connection to autocommit mode until the next call to
232
     * ProductProcessor::beginTransaction() starts a new transaction.
233
     *
234
     * @return boolean Returns TRUE on success or FALSE on failure
235
     * @link http://php.net/manual/en/pdo.commit.php
236
     */
237
    public function commit()
238
    {
239
        return $this->connection->commit();
240
    }
241
242
    /**
243
     * Rolls back the current transaction, as initiated by ProductProcessor::beginTransaction().
244
     *
245
     * If the database was set to autocommit mode, this function will restore autocommit mode after it has
246
     * rolled back the transaction.
247
     *
248
     * Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition
249
     * language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit
250
     * COMMIT will prevent you from rolling back any other changes within the transaction boundary.
251
     *
252
     * @return boolean Returns TRUE on success or FALSE on failure
253
     * @link http://php.net/manual/en/pdo.rollback.php
254
     */
255
    public function rollBack()
256
    {
257
        return $this->connection->rollBack();
258
    }
259
260
    /**
261
     * Set's the action with the product bundle option CRUD methods.
262
     *
263
     * @param \TechDivision\Import\Actions\ActionInterface $productBundleOptionAction The action with the product bundle option CRUD methods
264
     *
265
     * @return void
266
     */
267
    public function setProductBundleOptionAction(ActionInterface $productBundleOptionAction)
268
    {
269
        $this->productBundleOptionAction = $productBundleOptionAction;
270
    }
271
272
    /**
273
     * Return's the action with the product bundle option CRUD methods.
274
     *
275
     * @return \TechDivision\Import\Actions\ActionInterface The action instance
276
     */
277
    public function getProductBundleOptionAction()
278
    {
279
        return $this->productBundleOptionAction;
280
    }
281
282
    /**
283
     * Set's the action with the product bundle option value CRUD methods.
284
     *
285
     * @param \TechDivision\Import\Actions\ActionInterface $productBundleOptionValueAction The action with the product bundle option value CRUD methods
286
     *
287
     * @return void
288
     */
289
    public function setProductBundleOptionValueAction(ActionInterface $productBundleOptionValueAction)
290
    {
291
        $this->productBundleOptionValueAction = $productBundleOptionValueAction;
292
    }
293
294
    /**
295
     * Return's the action with the product bundle option value CRUD methods.
296
     *
297
     * @return \TechDivision\Import\Actions\ActionInterface The action instance
298
     */
299
    public function getProductBundleOptionValueAction()
300
    {
301
        return $this->productBundleOptionValueAction;
302
    }
303
304
    /**
305
     * Set's the action with the product bundle selection CRUD methods.
306
     *
307
     * @param \TechDivision\Import\Actions\ActionInterface $productBundleSelectionAction The action with the product bundle selection CRUD methods
308
     *
309
     * @return void
310
     */
311
    public function setProductBundleSelectionAction(ActionInterface $productBundleSelectionAction)
312
    {
313
        $this->productBundleSelectionAction = $productBundleSelectionAction;
314
    }
315
316
    /**
317
     * Return's the action with the product bundle selection CRUD methods.
318
     *
319
     * @return \TechDivision\Import\Actions\ActionInterface The action instance
320
     */
321
    public function getProductBundleSelectionAction()
322
    {
323
        return $this->productBundleSelectionAction;
324
    }
325
326
    /**
327
     * Set's the action with the product bundle selection price CRUD methods.
328
     *
329
     * @param \TechDivision\Import\Actions\ActionInterface $productBundleSelectionPriceAction The action with the product bundle selection price CRUD methods
330
     *
331
     * @return void
332
     */
333
    public function setProductBundleSelectionPriceAction(ActionInterface $productBundleSelectionPriceAction)
334
    {
335
        $this->productBundleSelectionPriceAction = $productBundleSelectionPriceAction;
336
    }
337
338
    /**
339
     * Return's the action with the product bundle selection price CRUD methods.
340
     *
341
     * @return \TechDivision\Import\Actions\ActionInterface The action instance
342
     */
343
    public function getProductBundleSelectionPriceAction()
344
    {
345
        return $this->productBundleSelectionPriceAction;
346
    }
347
348
    /**
349
     * Set's the action with the product relation CRUD methods.
350
     *
351
     * @param \TechDivision\Import\Actions\ActionInterface $productRelationAction The action with the product relation CRUD methods
352
     *
353
     * @return void
354
     */
355
    public function setProductRelationAction(ActionInterface $productRelationAction)
356
    {
357
        $this->productRelationAction = $productRelationAction;
358
    }
359
360
    /**
361
     * Return's the action with the product relation CRUD methods.
362
     *
363
     * @return \TechDivision\Import\Actions\ActionInterface The action instance
364
     */
365
    public function getProductRelationAction()
366
    {
367
        return $this->productRelationAction;
368
    }
369
370
    /**
371
     * Set's the repository to load bundle option data.
372
     *
373
     * @param \TechDivision\Import\Product\Bundle\Repositories\BundleOptionRepositoryInterface $bundleOptionRespository The repository instance
374
     *
375
     * @return void
376
     */
377
    public function setBundleOptionRepository(BundleOptionRepositoryInterface $bundleOptionRespository)
378
    {
379
        $this->bundleOptionRespository = $bundleOptionRespository;
380
    }
381
382
    /**
383
     * Return's the respository to load bundle option data.
384
     *
385
     * @return \TechDivision\Import\Product\Bundle\Repositories\BundleOptionRepositoryInterface The repository instance
386
     */
387
    public function getBundleOptionRepository()
388
    {
389
        return $this->bundleOptionRespository;
390
    }
391
392
    /**
393
     * Set's the repository to load bundle option value data.
394
     *
395
     * @param \TechDivision\Import\Product\Bundle\Repositories\BundleOptionValueRepositoryInterface $bundleOptionValueRespository The repository instance
396
     *
397
     * @return void
398
     */
399
    public function setBundleOptionValueRepository(BundleOptionValueRepositoryInterface $bundleOptionValueRespository)
400
    {
401
        $this->bundleOptionValueRespository = $bundleOptionValueRespository;
402
    }
403
404
    /**
405
     * Return's the respository to load bundle option value data.
406
     *
407
     * @return \TechDivision\Import\Product\Bundle\Repositories\BundleOptionValueRepositoryInterface The repository instance
408
     */
409
    public function getBundleOptionValueRepository()
410
    {
411
        return $this->bundleOptionValueRespository;
412
    }
413
414
    /**
415
     * Set's the repository to load bundle selection data.
416
     *
417
     * @param \TechDivision\Import\Product\Bundle\Repositories\BundleSelectionRepositoryInterface $bundleSelectionRespository The repository instance
418
     *
419
     * @return void
420
     */
421
    public function setBundleSelectionRepository(BundleSelectionRepositoryInterface $bundleSelectionRespository)
422
    {
423
        $this->bundleSelectionRespository = $bundleSelectionRespository;
424
    }
425
426
    /**
427
     * Return's the respository to load bundle selection data.
428
     *
429
     * @return \TechDivision\Import\Product\Bundle\Repositories\BundleSelectionRepositoryInterface The repository instance
430
     */
431
    public function getBundleSelectionRepository()
432
    {
433
        return $this->bundleSelectionRespository;
434
    }
435
436
    /**
437
     * Set's the repository to load bundle selection price data.
438
     *
439
     * @param \TechDivision\Import\Product\Bundle\Repositories\BundleSelectionPriceRepositoryInterface $bundleSelectionPriceRespository The repository instance
440
     *
441
     * @return void
442
     */
443
    public function setBundleSelectionPriceRepository(BundleSelectionPriceRepositoryInterface $bundleSelectionPriceRespository)
444
    {
445
        $this->bundleSelectionPriceRespository = $bundleSelectionPriceRespository;
446
    }
447
448
    /**
449
     * Return's the respository to load bundle selection price data.
450
     *
451
     * @return \TechDivision\Import\Product\Bundle\Repositories\BundleSelectionPriceRepositoryInterface The repository instance
452
     */
453
    public function getBundleSelectionPriceRepository()
454
    {
455
        return $this->bundleSelectionPriceRespository;
456
    }
457
458
    /**
459
     * Set's the repository to access product relations.
460
     *
461
     * @param \TechDivision\Import\Product\Repositories\ProductRelationRepositoryInterface $productRelationRepository The repository instance
462
     *
463
     * @return void
464
     */
465
    public function setProductRelationRepository(ProductRelationRepositoryInterface $productRelationRepository)
466
    {
467
        $this->productRelationRepository = $productRelationRepository;
468
    }
469
470
    /**
471
     * Return's the repository to access product relations.
472
     *
473
     * @return \TechDivision\Import\Product\Repositories\ProductRelationRepositoryInterface The repository instance
474
     */
475
    public function getProductRelationRepository()
476
    {
477
        return $this->productRelationRepository;
478
    }
479
480
    /**
481
     * Load's and return's a raw entity without primary key but the mandatory members only and nulled values.
482
     *
483
     * @param string $entityTypeCode The entity type code to return the raw entity for
484
     * @param array  $data           An array with data that will be used to initialize the raw entity with
485
     *
486
     * @return array The initialized entity
487
     */
488
    public function loadRawEntity($entityTypeCode, array $data = array())
489
    {
490
        return $this->getRawEntityLoader()->load($entityTypeCode, $data);
0 ignored issues
show
Unused Code introduced by
The call to LoaderInterface::load() has too many arguments starting with $entityTypeCode.

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.

Loading history...
Bug Best Practice introduced by
The return type of return $this->getRawEnti...entityTypeCode, $data); (ArrayAccess) is incompatible with the return type declared by the interface TechDivision\Import\Prod...nterface::loadRawEntity of type array.

If you return a value from a function or method, it should be a sub-type of the type that is given by the parent type f.e. an interface, or abstract method. This is more formally defined by the Lizkov substitution principle, and guarantees that classes that depend on the parent type can use any instance of a child type interchangably. This principle also belongs to the SOLID principles for object oriented design.

Let’s take a look at an example:

class Author {
    private $name;

    public function __construct($name) {
        $this->name = $name;
    }

    public function getName() {
        return $this->name;
    }
}

abstract class Post {
    public function getAuthor() {
        return 'Johannes';
    }
}

class BlogPost extends Post {
    public function getAuthor() {
        return new Author('Johannes');
    }
}

class ForumPost extends Post { /* ... */ }

function my_function(Post $post) {
    echo strtoupper($post->getAuthor());
}

Our function my_function expects a Post object, and outputs the author of the post. The base class Post returns a simple string and outputting a simple string will work just fine. However, the child class BlogPost which is a sub-type of Post instead decided to return an object, and is therefore violating the SOLID principles. If a BlogPost were passed to my_function, PHP would not complain, but ultimately fail when executing the strtoupper call in its body.

Loading history...
491
    }
492
493
    /**
494
     * Load's the bundle option with the passed name, store + parent ID.
495
     *
496
     * @param string  $title    The title of the bundle option to be returned
497
     * @param integer $storeId  The store ID of the bundle option to be returned
498
     * @param integer $parentId The entity of the product the bundle option is related with
499
     *
500
     * @return array The bundle option
501
     */
502
    public function loadBundleOption($title, $storeId, $parentId)
503
    {
504
        return $this->getBundleOptionRepository()->findOneByNameAndStoreIdAndParentId($title, $storeId, $parentId);
505
    }
506
507
    /**
508
     * Load's the bundle option value with the passed name, store + parent ID.
509
     *
510
     * @param string  $title    The title of the bundle option value to be returned
511
     * @param integer $storeId  The store ID of the bundle option value to be returned
512
     * @param integer $parentId The entity of the product the bundle option value is related with
513
     *
514
     * @return array The bundle option
515
     */
516
    public function loadBundleOptionValue($title, $storeId, $parentId)
517
    {
518
        return $this->getBundleOptionValueRepository()->findOneByNameAndStoreIdAndParentId($title, $storeId, $parentId);
519
    }
520
521
    /**
522
     * Load's the bundle selection value with the passed option/product/parent product ID.
523
     *
524
     * @param integer $optionId        The option ID of the bundle selection to be returned
525
     * @param integer $productId       The product ID of the bundle selection to be returned
526
     * @param integer $parentProductId The parent product ID of the bundle selection to be returned
527
     *
528
     * @return array The bundle selection
529
     */
530
    public function loadBundleSelection($optionId, $productId, $parentProductId)
531
    {
532
        return $this->getBundleSelectionRepository()->findOneByOptionIdAndProductIdAndParentProductId($optionId, $productId, $parentProductId);
533
    }
534
535
    /**
536
     * Load's the bundle selection price with the passed selection/parent product/website ID.
537
     *
538
     * @param integer $selectionId     The selection ID of the bundle selection price to be returned
539
     * @param integer $parentProductId The parent product ID of the bundle selection price to be returned
540
     * @param integer $websiteId       The website ID of the bundle selection price to be returned
541
     *
542
     * @return array The bundle selection price
543
     */
544
    public function loadBundleSelectionPrice($selectionId, $parentProductId, $websiteId)
545
    {
546
        return $this->getBundleSelectionPriceRepository()->findOneByOptionIdAndProductIdAndParentProductId($selectionId, $parentProductId, $websiteId);
547
    }
548
549
    /**
550
     * Load's the product relation with the passed parent/child ID.
551
     *
552
     * @param integer $parentId The entity ID of the product relation's parent product
553
     * @param integer $childId  The entity ID of the product relation's child product
554
     *
555
     * @return array The product relation
556
     */
557
    public function loadProductRelation($parentId, $childId)
558
    {
559
        return $this->getProductRelationRepository()->findOneByParentIdAndChildId($parentId, $childId);
560
    }
561
562
    /**
563
     * Persist's the passed product bundle option data and return's the ID.
564
     *
565
     * @param array $productBundleOption The product bundle option data to persist
566
     *
567
     * @return string The ID of the persisted entity
568
     */
569
    public function persistProductBundleOption($productBundleOption)
570
    {
571
        return $this->getProductBundleOptionAction()->persist($productBundleOption);
572
    }
573
574
    /**
575
     * Persist's the passed product bundle option value data.
576
     *
577
     * @param array $productBundleOptionValue The product bundle option value data to persist
578
     *
579
     * @return void
580
     */
581
    public function persistProductBundleOptionValue($productBundleOptionValue)
582
    {
583
        $this->getProductBundleOptionValueAction()->persist($productBundleOptionValue);
584
    }
585
586
    /**
587
     * Persist's the passed product bundle selection data and return's the ID.
588
     *
589
     * @param array $productBundleSelection The product bundle selection data to persist
590
     *
591
     * @return string The ID of the persisted entity
592
     */
593
    public function persistProductBundleSelection($productBundleSelection)
594
    {
595
        return $this->getProductBundleSelectionAction()->persist($productBundleSelection);
596
    }
597
598
    /**
599
     * Persist's the passed product bundle selection price data and return's the ID.
600
     *
601
     * @param array $productBundleSelectionPrice The product bundle selection price data to persist
602
     *
603
     * @return void
604
     */
605
    public function persistProductBundleSelectionPrice($productBundleSelectionPrice)
606
    {
607
        return $this->getProductBundleSelectionPriceAction()->persist($productBundleSelectionPrice);
608
    }
609
610
    /**
611
     * Persist's the passed product relation data and return's the ID.
612
     *
613
     * @param array       $productRelation The product relation data to persist
614
     * @param string|null $name            The name of the prepared statement that has to be executed
615
     *
616
     * @return void
617
     */
618
    public function persistProductRelation($productRelation, $name = null)
619
    {
620
        return $this->getProductRelationAction()->persist($productRelation, $name);
621
    }
622
}
623