Completed
Pull Request — master (#114)
by Tim
10:48
created

getEavAttributeByIsUserDefined()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
/**
4
 * TechDivision\Import\Product\Services\ProductBunchProcessor
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
18
 * @link      http://www.techdivision.com
19
 */
20
21
namespace TechDivision\Import\Product\Services;
22
23
use TechDivision\Import\Actions\UrlRewriteAction;
24
use TechDivision\Import\Connection\ConnectionInterface;
25
use TechDivision\Import\Product\Utils\MemberNames;
26
use TechDivision\Import\Product\Actions\CategoryProductAction;
27
use TechDivision\Import\Product\Actions\ProductAction;
28
use TechDivision\Import\Product\Actions\ProductDatetimeAction;
29
use TechDivision\Import\Product\Actions\ProductDecimalAction;
30
use TechDivision\Import\Product\Actions\ProductIntAction;
31
use TechDivision\Import\Product\Actions\ProductTextAction;
32
use TechDivision\Import\Product\Actions\ProductVarcharAction;
33
use TechDivision\Import\Product\Actions\ProductWebsiteAction;
34
use TechDivision\Import\Product\Actions\StockItemAction;
35
use TechDivision\Import\Product\Actions\StockStatusAction;
36
use TechDivision\Import\Product\Repositories\CategoryProductRepository;
37
use TechDivision\Import\Product\Repositories\ProductDatetimeRepository;
38
use TechDivision\Import\Product\Repositories\ProductDecimalRepository;
39
use TechDivision\Import\Product\Repositories\ProductIntRepository;
40
use TechDivision\Import\Product\Repositories\ProductRepository;
41
use TechDivision\Import\Product\Repositories\ProductTextRepository;
42
use TechDivision\Import\Product\Repositories\ProductVarcharRepository;
43
use TechDivision\Import\Product\Repositories\ProductWebsiteRepository;
44
use TechDivision\Import\Product\Repositories\StockItemRepository;
45
use TechDivision\Import\Product\Repositories\StockStatusRepository;
46
use TechDivision\Import\Repositories\EavAttributeOptionValueRepository;
47
use TechDivision\Import\Repositories\EavAttributeRepository;
48
use TechDivision\Import\Product\Assemblers\ProductAttributeAssemblerInterface;
49
50
/**
51
 * The product bunch processor implementation.
52
 *
53
 * @author    Tim Wagner <[email protected]>
54
 * @copyright 2016 TechDivision GmbH <[email protected]>
55
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
56
 * @link      https://github.com/techdivision/import-product
57
 * @link      http://www.techdivision.com
58
 */
59
class ProductBunchProcessor implements ProductBunchProcessorInterface
60
{
61
62
    /**
63
     * A PDO connection initialized with the values from the Doctrine EntityManager.
64
     *
65
     * @var \TechDivision\Import\Connection\ConnectionInterface
66
     */
67
    protected $connection;
68
69
    /**
70
     * The repository to access EAV attribute option values.
71
     *
72
     * @var \TechDivision\Import\Repositories\EavAttributeOptionValueRepository
73
     */
74
    protected $eavAttributeOptionValueRepository;
75
76
    /**
77
     * The repository to access EAV attributes.
78
     *
79
     * @var \TechDivision\Import\Repositories\EavAttributeRepository
80
     */
81
    protected $eavAttributeRepository;
82
83
    /**
84
     * The action for product CRUD methods.
85
     *
86
     * @var \TechDivision\Import\Product\Actions\ProductAction
87
     */
88
    protected $productAction;
89
90
    /**
91
     * The action for product varchar attribute CRUD methods.
92
     *
93
     * @var \TechDivision\Import\Product\Actions\ProductVarcharAction
94
     */
95
    protected $productVarcharAction;
96
97
    /**
98
     * The action for product text attribute CRUD methods.
99
     *
100
     * @var \TechDivision\Import\Product\Actions\ProductTextAction
101
     */
102
    protected $productTextAction;
103
104
    /**
105
     * The action for product int attribute CRUD methods.
106
     *
107
     * @var \TechDivision\Import\Product\Actions\ProductIntAction
108
     */
109
    protected $productIntAction;
110
111
    /**
112
     * The action for product decimal attribute CRUD methods.
113
     *
114
     * @var \TechDivision\Import\Product\Actions\ProductDecimalAction
115
     */
116
    protected $productDecimalAction;
117
118
    /**
119
     * The action for product datetime attribute CRUD methods.
120
     *
121
     * @var \TechDivision\Import\Product\Actions\ProductDatetimeAction
122
     */
123
    protected $productDatetimeAction;
124
125
    /**
126
     * The action for product website CRUD methods.
127
     *
128
     * @var \TechDivision\Import\Product\Actions\ProductWebsiteAction
129
     */
130
    protected $productWebsiteAction;
131
132
    /**
133
     * The action for category product relation CRUD methods.
134
     *
135
     * @var \TechDivision\Import\Product\Actions\CategoryProductAction
136
     */
137
    protected $categoryProductAction;
138
139
    /**
140
     * The action for stock item CRUD methods.
141
     *
142
     * @var \TechDivision\Import\Product\Actions\StockItemAction
143
     */
144
    protected $stockItemAction;
145
146
    /**
147
     * The action for stock status CRUD methods.
148
     *
149
     * @var \TechDivision\Import\Product\Actions\StockStatusAction
150
     */
151
    protected $stockStatusAction;
152
153
    /**
154
     * The action for URL rewrite CRUD methods.
155
     *
156
     * @var \TechDivision\Import\Actions\UrlRewriteAction
157
     */
158
    protected $urlRewriteAction;
159
160
    /**
161
     * The repository to load the products with.
162
     *
163
     * @var \TechDivision\Import\Product\Repositories\ProductRepository
164
     */
165
    protected $productRepository;
166
167
    /**
168
     * The repository to load the product website relations with.
169
     *
170
     * @var \TechDivision\Import\Product\Repositories\ProductWebsiteRepository
171
     */
172
    protected $productWebsiteRepository;
173
174
    /**
175
     * The repository to load the product datetime attribute with.
176
     *
177
     * @var \TechDivision\Import\Product\Repositories\ProductDatetimeRepository
178
     */
179
    protected $productDatetimeRepository;
180
181
    /**
182
     * The repository to load the product decimal attribute with.
183
     *
184
     * @var \TechDivision\Import\Product\Repositories\ProductDecimalRepository
185
     */
186
    protected $productDecimalRepository;
187
188
    /**
189
     * The repository to load the product integer attribute with.
190
     *
191
     * @var \TechDivision\Import\Product\Repositories\ProductIntRepository
192
     */
193
    protected $productIntRepository;
194
195
    /**
196
     * The repository to load the product text attribute with.
197
     *
198
     * @var \TechDivision\Import\Product\Repositories\ProductTextRepository
199
     */
200
    protected $productTextRepository;
201
202
    /**
203
     * The repository to load the product varchar attribute with.
204
     *
205
     * @var \TechDivision\Import\Product\Repositories\ProductVarcharRepository
206
     */
207
    protected $productVarcharRepository;
208
209
    /**
210
     * The repository to load the category product relations with.
211
     *
212
     * @var \TechDivision\Import\Product\Repositories\CategoryProductRepository
213
     */
214
    protected $categoryProductRepository;
215
216
    /**
217
     * The repository to load the stock status with.
218
     *
219
     * @var \TechDivision\Import\Product\Repositories\StockStatusRepository
220
     */
221
    protected $stockStatusRepository;
222
223
    /**
224
     * The repository to load the stock item with.
225
     *
226
     * @var \TechDivision\Import\Product\Repositories\StockItemRepository
227
     */
228
    protected $stockItemRepository;
229
230
    /**
231
     * The assembler to load the product attributes with.
232
     *
233
     * @var \TechDivision\Import\Product\Assemblers\ProductAttributeAssemblerInterface
234
     */
235
    protected $productAttributeAssembler;
236
237
    /**
238
     * Initialize the processor with the necessary assembler and repository instances.
239
     *
240
     * @param \TechDivision\Import\Connection\ConnectionInterface                        $connection                        The connection to use
241
     * @param \TechDivision\Import\Product\Repositories\ProductRepository                $productRepository                 The product repository to use
242
     * @param \TechDivision\Import\Product\Repositories\ProductWebsiteRepository         $productWebsiteRepository          The product website repository to use
243
     * @param \TechDivision\Import\Product\Repositories\ProductDatetimeRepository        $productDatetimeRepository         The product datetime repository to use
244
     * @param \TechDivision\Import\Product\Repositories\ProductDecimalRepository         $productDecimalRepository          The product decimal repository to use
245
     * @param \TechDivision\Import\Product\Repositories\ProductIntRepository             $productIntRepository              The product integer repository to use
246
     * @param \TechDivision\Import\Product\Repositories\ProductTextRepository            $productTextRepository             The product text repository to use
247
     * @param \TechDivision\Import\Product\Repositories\ProductVarcharRepository         $productVarcharRepository          The product varchar repository to use
248
     * @param \TechDivision\Import\Product\Repositories\CategoryProductRepository        $categoryProductRepository         The category product repository to use
249
     * @param \TechDivision\Import\Product\Repositories\StockStatusRepository            $stockStatusRepository             The stock status repository to use
250
     * @param \TechDivision\Import\Product\Repositories\StockItemRepository              $stockItemRepository               The stock item repository to use
251
     * @param \TechDivision\Import\Repositories\EavAttributeOptionValueRepository        $eavAttributeOptionValueRepository The EAV attribute option value repository to use
252
     * @param \TechDivision\Import\Repositories\EavAttributeRepository                   $eavAttributeRepository            The EAV attribute repository to use
253
     * @param \TechDivision\Import\Product\Actions\CategoryProductAction                 $categoryProductAction             The category product action to use
254
     * @param \TechDivision\Import\Product\Actions\ProductDatetimeAction                 $productDatetimeAction             The product datetime action to use
255
     * @param \TechDivision\Import\Product\Actions\ProductDecimalAction                  $productDecimalAction              The product decimal action to use
256
     * @param \TechDivision\Import\Product\Actions\ProductIntAction                      $productIntAction                  The product integer action to use
257
     * @param \TechDivision\Import\Product\Actions\ProductAction                         $productAction                     The product action to use
258
     * @param \TechDivision\Import\Product\Actions\ProductTextAction                     $productTextAction                 The product text action to use
259
     * @param \TechDivision\Import\Product\Actions\ProductVarcharAction                  $productVarcharAction              The product varchar action to use
260
     * @param \TechDivision\Import\Product\Actions\ProductWebsiteAction                  $productWebsiteAction              The product website action to use
261
     * @param \TechDivision\Import\Product\Actions\StockItemAction                       $stockItemAction                   The stock item action to use
262
     * @param \TechDivision\Import\Product\Actions\StockStatusAction                     $stockStatusAction                 The stock status action to use
263
     * @param \TechDivision\Import\Actions\UrlRewriteAction                              $urlRewriteAction                  The URL rewrite action to use
264
     * @param \TechDivision\Import\Product\Assemblers\ProductAttributeAssemblerInterface $productAttributeAssembler         The assembler to load the product attributes with
265
     */
266
    public function __construct(
267
        ConnectionInterface $connection,
268
        ProductRepository $productRepository,
269
        ProductWebsiteRepository $productWebsiteRepository,
270
        ProductDatetimeRepository $productDatetimeRepository,
271
        ProductDecimalRepository $productDecimalRepository,
272
        ProductIntRepository $productIntRepository,
273
        ProductTextRepository $productTextRepository,
274
        ProductVarcharRepository $productVarcharRepository,
275
        CategoryProductRepository $categoryProductRepository,
276
        StockStatusRepository $stockStatusRepository,
277
        StockItemRepository $stockItemRepository,
278
        EavAttributeOptionValueRepository $eavAttributeOptionValueRepository,
279
        EavAttributeRepository $eavAttributeRepository,
280
        CategoryProductAction $categoryProductAction,
281
        ProductDatetimeAction $productDatetimeAction,
282
        ProductDecimalAction $productDecimalAction,
283
        ProductIntAction $productIntAction,
284
        ProductAction $productAction,
285
        ProductTextAction $productTextAction,
286
        ProductVarcharAction $productVarcharAction,
287
        ProductWebsiteAction $productWebsiteAction,
288
        StockItemAction $stockItemAction,
289
        StockStatusAction $stockStatusAction,
290
        UrlRewriteAction $urlRewriteAction,
291
        ProductAttributeAssemblerInterface $productAttributeAssembler
292
    ) {
293
        $this->setConnection($connection);
294
        $this->setProductRepository($productRepository);
295
        $this->setProductWebsiteRepository($productWebsiteRepository);
296
        $this->setProductDatetimeRepository($productDatetimeRepository);
297
        $this->setProductDecimalRepository($productDecimalRepository);
298
        $this->setProductIntRepository($productIntRepository);
299
        $this->setProductTextRepository($productTextRepository);
300
        $this->setProductVarcharRepository($productVarcharRepository);
301
        $this->setCategoryProductRepository($categoryProductRepository);
302
        $this->setStockStatusRepository($stockStatusRepository);
303
        $this->setStockItemRepository($stockItemRepository);
304
        $this->setEavAttributeOptionValueRepository($eavAttributeOptionValueRepository);
305
        $this->setEavAttributeRepository($eavAttributeRepository);
306
        $this->setCategoryProductAction($categoryProductAction);
307
        $this->setProductDatetimeAction($productDatetimeAction);
308
        $this->setProductDecimalAction($productDecimalAction);
309
        $this->setProductIntAction($productIntAction);
310
        $this->setProductAction($productAction);
311
        $this->setProductTextAction($productTextAction);
312
        $this->setProductVarcharAction($productVarcharAction);
313
        $this->setProductWebsiteAction($productWebsiteAction);
314
        $this->setStockItemAction($stockItemAction);
315
        $this->setStockStatusAction($stockStatusAction);
316
        $this->setUrlRewriteAction($urlRewriteAction);
317
        $this->setProductAttributeAssembler($productAttributeAssembler);
318
    }
319
320
    /**
321
     * Set's the passed connection.
322
     *
323
     * @param \TechDivision\Import\Connection\ConnectionInterface $connection The connection to set
324
     *
325
     * @return void
326
     */
327
    public function setConnection(ConnectionInterface $connection)
328
    {
329
        $this->connection = $connection;
330
    }
331
332
    /**
333
     * Return's the connection.
334
     *
335
     * @return \TechDivision\Import\Connection\ConnectionInterface The connection instance
336
     */
337
    public function getConnection()
338
    {
339
        return $this->connection;
340
    }
341
342
    /**
343
     * Turns off autocommit mode. While autocommit mode is turned off, changes made to the database via the PDO
344
     * object instance are not committed until you end the transaction by calling ProductProcessor::commit().
345
     * Calling ProductProcessor::rollBack() will roll back all changes to the database and return the connection
346
     * to autocommit mode.
347
     *
348
     * @return boolean Returns TRUE on success or FALSE on failure
349
     * @link http://php.net/manual/en/pdo.begintransaction.php
350
     */
351
    public function beginTransaction()
352
    {
353
        return $this->connection->beginTransaction();
354
    }
355
356
    /**
357
     * Commits a transaction, returning the database connection to autocommit mode until the next call to
358
     * ProductProcessor::beginTransaction() starts a new transaction.
359
     *
360
     * @return boolean Returns TRUE on success or FALSE on failure
361
     * @link http://php.net/manual/en/pdo.commit.php
362
     */
363
    public function commit()
364
    {
365
        return $this->connection->commit();
366
    }
367
368
    /**
369
     * Rolls back the current transaction, as initiated by ProductProcessor::beginTransaction().
370
     *
371
     * If the database was set to autocommit mode, this function will restore autocommit mode after it has
372
     * rolled back the transaction.
373
     *
374
     * Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition
375
     * language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit
376
     * COMMIT will prevent you from rolling back any other changes within the transaction boundary.
377
     *
378
     * @return boolean Returns TRUE on success or FALSE on failure
379
     * @link http://php.net/manual/en/pdo.rollback.php
380
     */
381
    public function rollBack()
382
    {
383
        return $this->connection->rollBack();
384
    }
385
386
    /**
387
     * Set's the repository to access EAV attribute option values.
388
     *
389
     * @param \TechDivision\Import\Repositories\EavAttributeOptionValueRepository $eavAttributeOptionValueRepository The repository to access EAV attribute option values
390
     *
391
     * @return void
392
     */
393
    public function setEavAttributeOptionValueRepository($eavAttributeOptionValueRepository)
394
    {
395
        $this->eavAttributeOptionValueRepository = $eavAttributeOptionValueRepository;
396
    }
397
398
    /**
399
     * Return's the repository to access EAV attribute option values.
400
     *
401
     * @return \TechDivision\Import\Repositories\EavAttributeOptionValueRepository The repository instance
402
     */
403
    public function getEavAttributeOptionValueRepository()
404
    {
405
        return $this->eavAttributeOptionValueRepository;
406
    }
407
408
    /**
409
     * Set's the repository to access EAV attributes.
410
     *
411
     * @param \TechDivision\Import\Repositories\EavAttributeRepository $eavAttributeRepository The repository to access EAV attributes
412
     *
413
     * @return void
414
     */
415
    public function setEavAttributeRepository($eavAttributeRepository)
416
    {
417
        $this->eavAttributeRepository = $eavAttributeRepository;
418
    }
419
420
    /**
421
     * Return's the repository to access EAV attributes.
422
     *
423
     * @return \TechDivision\Import\Repositories\EavAttributeRepository The repository instance
424
     */
425
    public function getEavAttributeRepository()
426
    {
427
        return $this->eavAttributeRepository;
428
    }
429
430
    /**
431
     * Return's an array with the available EAV attributes for the passed is user defined flag.
432
     *
433
     * @param integer $isUserDefined The flag itself
434
     *
435
     * @return array The array with the EAV attributes matching the passed flag
436
     */
437
    public function getEavAttributeByIsUserDefined($isUserDefined = 1)
438
    {
439
        return $this->getEavAttributeRepository()->findAllByIsUserDefined($isUserDefined);
440
    }
441
442
    /**
443
     * Set's the action with the product CRUD methods.
444
     *
445
     * @param \TechDivision\Import\Product\Actions\ProductAction $productAction The action with the product CRUD methods
446
     *
447
     * @return void
448
     */
449
    public function setProductAction($productAction)
450
    {
451
        $this->productAction = $productAction;
452
    }
453
454
    /**
455
     * Return's the action with the product CRUD methods.
456
     *
457
     * @return \TechDivision\Import\Product\Actions\ProductAction The action instance
458
     */
459
    public function getProductAction()
460
    {
461
        return $this->productAction;
462
    }
463
464
    /**
465
     * Set's the action with the product varchar attribute CRUD methods.
466
     *
467
     * @param \TechDivision\Import\Product\Actions\ProductVarcharAction $productVarcharAction The action with the product varchar attriute CRUD methods
468
     *
469
     * @return void
470
     */
471
    public function setProductVarcharAction($productVarcharAction)
472
    {
473
        $this->productVarcharAction = $productVarcharAction;
474
    }
475
476
    /**
477
     * Return's the action with the product varchar attribute CRUD methods.
478
     *
479
     * @return \TechDivision\Import\Product\Actions\ProductVarcharAction The action instance
480
     */
481
    public function getProductVarcharAction()
482
    {
483
        return $this->productVarcharAction;
484
    }
485
486
    /**
487
     * Set's the action with the product text attribute CRUD methods.
488
     *
489
     * @param \TechDivision\Import\Product\Actions\ProductTextAction $productTextAction The action with the product text attriute CRUD methods
490
     *
491
     * @return void
492
     */
493
    public function setProductTextAction($productTextAction)
494
    {
495
        $this->productTextAction = $productTextAction;
496
    }
497
498
    /**
499
     * Return's the action with the product text attribute CRUD methods.
500
     *
501
     * @return \TechDivision\Import\Product\Actions\ProductTextAction The action instance
502
     */
503
    public function getProductTextAction()
504
    {
505
        return $this->productTextAction;
506
    }
507
508
    /**
509
     * Set's the action with the product int attribute CRUD methods.
510
     *
511
     * @param \TechDivision\Import\Product\Actions\ProductIntAction $productIntAction The action with the product int attriute CRUD methods
512
     *
513
     * @return void
514
     */
515
    public function setProductIntAction($productIntAction)
516
    {
517
        $this->productIntAction = $productIntAction;
518
    }
519
520
    /**
521
     * Return's the action with the product int attribute CRUD methods.
522
     *
523
     * @return \TechDivision\Import\Product\Actions\ProductIntAction The action instance
524
     */
525
    public function getProductIntAction()
526
    {
527
        return $this->productIntAction;
528
    }
529
530
    /**
531
     * Set's the action with the product decimal attribute CRUD methods.
532
     *
533
     * @param \TechDivision\Import\Product\Actions\ProductDecimalAction $productDecimalAction The action with the product decimal attriute CRUD methods
534
     *
535
     * @return void
536
     */
537
    public function setProductDecimalAction($productDecimalAction)
538
    {
539
        $this->productDecimalAction = $productDecimalAction;
540
    }
541
542
    /**
543
     * Return's the action with the product decimal attribute CRUD methods.
544
     *
545
     * @return \TechDivision\Import\Product\Actions\ProductDecimalAction The action instance
546
     */
547
    public function getProductDecimalAction()
548
    {
549
        return $this->productDecimalAction;
550
    }
551
552
    /**
553
     * Set's the action with the product datetime attribute CRUD methods.
554
     *
555
     * @param \TechDivision\Import\Product\Actions\ProductDatetimeAction $productDatetimeAction The action with the product datetime attriute CRUD methods
556
     *
557
     * @return void
558
     */
559
    public function setProductDatetimeAction($productDatetimeAction)
560
    {
561
        $this->productDatetimeAction = $productDatetimeAction;
562
    }
563
564
    /**
565
     * Return's the action with the product datetime attribute CRUD methods.
566
     *
567
     * @return \TechDivision\Import\Product\Actions\ProductDatetimeAction The action instance
568
     */
569
    public function getProductDatetimeAction()
570
    {
571
        return $this->productDatetimeAction;
572
    }
573
574
    /**
575
     * Set's the action with the product website CRUD methods.
576
     *
577
     * @param \TechDivision\Import\Product\Actions\ProductWebsiteAction $productWebsiteAction The action with the product website CRUD methods
578
     *
579
     * @return void
580
     */
581
    public function setProductWebsiteAction($productWebsiteAction)
582
    {
583
        $this->productWebsiteAction = $productWebsiteAction;
584
    }
585
586
    /**
587
     * Return's the action with the product website CRUD methods.
588
     *
589
     * @return \TechDivision\Import\Product\Actions\ProductWebsiteAction The action instance
590
     */
591
    public function getProductWebsiteAction()
592
    {
593
        return $this->productWebsiteAction;
594
    }
595
596
    /**
597
     * Set's the action with the category product relation CRUD methods.
598
     *
599
     * @param \TechDivision\Import\Product\Actions\CategoryProductAction $categoryProductAction The action with the category product relation CRUD methods
600
     *
601
     * @return void
602
     */
603
    public function setCategoryProductAction($categoryProductAction)
604
    {
605
        $this->categoryProductAction = $categoryProductAction;
606
    }
607
608
    /**
609
     * Return's the action with the category product relation CRUD methods.
610
     *
611
     * @return \TechDivision\Import\Product\Actions\CategoryProductAction The action instance
612
     */
613
    public function getCategoryProductAction()
614
    {
615
        return $this->categoryProductAction;
616
    }
617
618
    /**
619
     * Set's the action with the stock item CRUD methods.
620
     *
621
     * @param \TechDivision\Import\Product\Actions\StockItemAction $stockItemAction The action with the stock item CRUD methods
622
     *
623
     * @return void
624
     */
625
    public function setStockItemAction($stockItemAction)
626
    {
627
        $this->stockItemAction = $stockItemAction;
628
    }
629
630
    /**
631
     * Return's the action with the stock item CRUD methods.
632
     *
633
     * @return \TechDivision\Import\Product\Actions\StockItemAction The action instance
634
     */
635
    public function getStockItemAction()
636
    {
637
        return $this->stockItemAction;
638
    }
639
640
    /**
641
     * Set's the action with the stock status CRUD methods.
642
     *
643
     * @param \TechDivision\Import\Product\Actions\StockStatusAction $stockStatusAction The action with the stock status CRUD methods
644
     *
645
     * @return void
646
     */
647
    public function setStockStatusAction($stockStatusAction)
648
    {
649
        $this->stockStatusAction = $stockStatusAction;
650
    }
651
652
    /**
653
     * Return's the action with the stock status CRUD methods.
654
     *
655
     * @return \TechDivision\Import\Product\Actions\StockStatusAction The action instance
656
     */
657
    public function getStockStatusAction()
658
    {
659
        return $this->stockStatusAction;
660
    }
661
662
    /**
663
     * Set's the action with the URL rewrite CRUD methods.
664
     *
665
     * @param \TechDivision\Import\Actions\UrlRewriteAction $urlRewriteAction The action with the URL rewrite CRUD methods
666
     *
667
     * @return void
668
     */
669
    public function setUrlRewriteAction($urlRewriteAction)
670
    {
671
        $this->urlRewriteAction = $urlRewriteAction;
672
    }
673
674
    /**
675
     * Return's the action with the URL rewrite CRUD methods.
676
     *
677
     * @return \TechDivision\Import\Actions\UrlRewriteAction The action instance
678
     */
679
    public function getUrlRewriteAction()
680
    {
681
        return $this->urlRewriteAction;
682
    }
683
684
    /**
685
     * Set's the repository to load the products with.
686
     *
687
     * @param \TechDivision\Import\Product\Repositories\ProductRepository $productRepository The repository instance
688
     *
689
     * @return void
690
     */
691
    public function setProductRepository($productRepository)
692
    {
693
        $this->productRepository = $productRepository;
694
    }
695
696
    /**
697
     * Return's the repository to load the products with.
698
     *
699
     * @return \TechDivision\Import\Product\Repositories\ProductRepository The repository instance
700
     */
701
    public function getProductRepository()
702
    {
703
        return $this->productRepository;
704
    }
705
706
    /**
707
     * Set's the repository to load the product website relations with.
708
     *
709
     * @param \TechDivision\Import\Product\Repositories\ProductWebsiteRepository $productWebsiteRepository The repository instance
710
     *
711
     * @return void
712
     */
713
    public function setProductWebsiteRepository($productWebsiteRepository)
714
    {
715
        $this->productWebsiteRepository = $productWebsiteRepository;
716
    }
717
718
    /**
719
     * Return's the repository to load the product website relations with.
720
     *
721
     * @return \TechDivision\Import\Product\Repositories\ProductWebsiteRepository The repository instance
722
     */
723
    public function getProductWebsiteRepository()
724
    {
725
        return $this->productWebsiteRepository;
726
    }
727
728
    /**
729
     * Set's the repository to load the product datetime attribute with.
730
     *
731
     * @param \TechDivision\Import\Product\Repositories\ProductDatetimeRepository $productDatetimeRepository The repository instance
732
     *
733
     * @return void
734
     */
735
    public function setProductDatetimeRepository($productDatetimeRepository)
736
    {
737
        $this->productDatetimeRepository = $productDatetimeRepository;
738
    }
739
740
    /**
741
     * Return's the repository to load the product datetime attribute with.
742
     *
743
     * @return \TechDivision\Import\Product\Repositories\ProductDatetimeRepository The repository instance
744
     */
745
    public function getProductDatetimeRepository()
746
    {
747
        return $this->productDatetimeRepository;
748
    }
749
750
    /**
751
     * Set's the repository to load the product decimal attribute with.
752
     *
753
     * @param \TechDivision\Import\Product\Repositories\ProductDecimalRepository $productDecimalRepository The repository instance
754
     *
755
     * @return void
756
     */
757
    public function setProductDecimalRepository($productDecimalRepository)
758
    {
759
        $this->productDecimalRepository = $productDecimalRepository;
760
    }
761
762
    /**
763
     * Return's the repository to load the product decimal attribute with.
764
     *
765
     * @return \TechDivision\Import\Product\Repositories\ProductDecimalRepository The repository instance
766
     */
767
    public function getProductDecimalRepository()
768
    {
769
        return $this->productDecimalRepository;
770
    }
771
772
    /**
773
     * Set's the repository to load the product integer attribute with.
774
     *
775
     * @param \TechDivision\Import\Product\Repositories\ProductIntRepository $productIntRepository The repository instance
776
     *
777
     * @return void
778
     */
779
    public function setProductIntRepository($productIntRepository)
780
    {
781
        $this->productIntRepository = $productIntRepository;
782
    }
783
784
    /**
785
     * Return's the repository to load the product integer attribute with.
786
     *
787
     * @return \TechDivision\Import\Product\Repositories\ProductIntRepository The repository instance
788
     */
789
    public function getProductIntRepository()
790
    {
791
        return $this->productIntRepository;
792
    }
793
794
    /**
795
     * Set's the repository to load the product text attribute with.
796
     *
797
     * @param \TechDivision\Import\Product\Repositories\ProductTextRepository $productTextRepository The repository instance
798
     *
799
     * @return void
800
     */
801
    public function setProductTextRepository($productTextRepository)
802
    {
803
        $this->productTextRepository = $productTextRepository;
804
    }
805
806
    /**
807
     * Return's the repository to load the product text attribute with.
808
     *
809
     * @return \TechDivision\Import\Product\Repositories\ProductTextRepository The repository instance
810
     */
811
    public function getProductTextRepository()
812
    {
813
        return $this->productTextRepository;
814
    }
815
816
    /**
817
     * Set's the repository to load the product varchar attribute with.
818
     *
819
     * @param \TechDivision\Import\Product\Repositories\ProductVarcharRepository $productVarcharRepository The repository instance
820
     *
821
     * @return void
822
     */
823
    public function setProductVarcharRepository($productVarcharRepository)
824
    {
825
        $this->productVarcharRepository = $productVarcharRepository;
826
    }
827
828
    /**
829
     * Return's the repository to load the product varchar attribute with.
830
     *
831
     * @return \TechDivision\Import\Product\Repositories\ProductVarcharRepository The repository instance
832
     */
833
    public function getProductVarcharRepository()
834
    {
835
        return $this->productVarcharRepository;
836
    }
837
838
    /**
839
     * Set's the repository to load the category product relations with.
840
     *
841
     * @param \TechDivision\Import\Product\Repositories\CategoryProductRepository $categoryProductRepository The repository instance
842
     *
843
     * @return void
844
     */
845
    public function setCategoryProductRepository($categoryProductRepository)
846
    {
847
        $this->categoryProductRepository = $categoryProductRepository;
848
    }
849
850
    /**
851
     * Return's the repository to load the category product relations with.
852
     *
853
     * @return \TechDivision\Import\Product\Repositories\CategoryProductRepository The repository instance
854
     */
855
    public function getCategoryProductRepository()
856
    {
857
        return $this->categoryProductRepository;
858
    }
859
860
    /**
861
     * Set's the repository to load the stock status with.
862
     *
863
     * @param \TechDivision\Import\Product\Repositories\StockStatusRepository $stockStatusRepository The repository instance
864
     *
865
     * @return void
866
     */
867
    public function setStockStatusRepository($stockStatusRepository)
868
    {
869
        $this->stockStatusRepository = $stockStatusRepository;
870
    }
871
872
    /**
873
     * Return's the repository to load the stock status with.
874
     *
875
     * @return \TechDivision\Import\Product\Repositories\StockStatusRepository The repository instance
876
     */
877
    public function getStockStatusRepository()
878
    {
879
        return $this->stockStatusRepository;
880
    }
881
882
    /**
883
     * Set's the repository to load the stock items with.
884
     *
885
     * @param \TechDivision\Import\Product\Repositories\StockItemRepository $stockItemRepository The repository instance
886
     *
887
     * @return void
888
     */
889
    public function setStockItemRepository($stockItemRepository)
890
    {
891
        $this->stockItemRepository = $stockItemRepository;
892
    }
893
894
    /**
895
     * Return's the repository to load the stock items with.
896
     *
897
     * @return \TechDivision\Import\Product\Repositories\StockItemRepository The repository instance
898
     */
899
    public function getStockItemRepository()
900
    {
901
        return $this->stockItemRepository;
902
    }
903
904
    /**
905
     * Set's the assembler to load the product attributes with.
906
     *
907
     * @param \TechDivision\Import\Product\Assemblers\ProductAttributeAssemblerInterface $productAttributeAssembler The assembler instance
908
     *
909
     * @return void
910
     */
911
    public function setProductAttributeAssembler(ProductAttributeAssemblerInterface $productAttributeAssembler)
912
    {
913
        $this->productAttributeAssembler = $productAttributeAssembler;
914
    }
915
916
    /**
917
     * Return's the assembler to load the product attributes with.
918
     *
919
     * @return \TechDivision\Import\Product\Assemblers\ProductAttributeAssemblerInterface The assembler instance
920
     */
921
    public function getProductAttributeAssembler()
922
    {
923
        return $this->productAttributeAssembler;
924
    }
925
926
    /**
927
     * Return's the category product relations for the product with the passed SKU.
928
     *
929
     * @param string $sku The product SKU to load the category relations for
930
     *
931
     * @return array The category product relations for the product with the passed SKU
932
     */
933
    public function getCategoryProductsBySku($sku)
934
    {
935
        return $this->getCategoryProductRepository()->findAllBySku($sku);
936
    }
937
938
    /**
939
     * Intializes the existing attributes for the entity with the passed primary key.
940
     *
941
     * @param string  $pk      The primary key of the entity to load the attributes for
942
     * @param integer $storeId The ID of the store view to load the attributes for
943
     *
944
     * @return array The entity attributes
945
     */
946
    public function getProductAttributesByPrimaryKeyAndStoreId($pk, $storeId)
947
    {
948
        return $this->getProductAttributeAssembler()->getProductAttributesByPrimaryKeyAndStoreId($pk, $storeId);
949
    }
950
951
    /**
952
     * Load's and return's the EAV attribute option value with the passed code, store ID and value.
953
     *
954
     * @param string  $attributeCode The code of the EAV attribute option to load
955
     * @param integer $storeId       The store ID of the attribute option to load
956
     * @param string  $value         The value of the attribute option to load
957
     *
958
     * @return array The EAV attribute option value
959
     */
960
    public function loadEavAttributeOptionValueByAttributeCodeAndStoreIdAndValue($attributeCode, $storeId, $value)
961
    {
962
        return $this->getEavAttributeOptionValueRepository()->findOneByAttributeCodeAndStoreIdAndValue($attributeCode, $storeId, $value);
963
    }
964
965
    /**
966
     * Load's and return's the product with the passed SKU.
967
     *
968
     * @param string $sku The SKU of the product to load
969
     *
970
     * @return array The product
971
     */
972
    public function loadProduct($sku)
973
    {
974
        return $this->getProductRepository()->findOneBySku($sku);
975
    }
976
977
    /**
978
     * Load's and return's the product website relation with the passed product and website ID.
979
     *
980
     * @param string $productId The product ID of the relation
981
     * @param string $websiteId The website ID of the relation
982
     *
983
     * @return array The product website
984
     */
985
    public function loadProductWebsite($productId, $websiteId)
986
    {
987
        return $this->getProductWebsiteRepository()->findOneByProductIdAndWebsite($productId, $websiteId);
988
    }
989
990
    /**
991
     * Return's the category product relation with the passed category/product ID.
992
     *
993
     * @param integer $categoryId The category ID of the category product relation to return
994
     * @param integer $productId  The product ID of the category product relation to return
995
     *
996
     * @return array The category product relation
997
     */
998
    public function loadCategoryProduct($categoryId, $productId)
999
    {
1000
        return $this->getCategoryProductRepository()->findOneByCategoryIdAndProductId($categoryId, $productId);
1001
    }
1002
1003
    /**
1004
     * Load's and return's the stock status with the passed product/website/stock ID.
1005
     *
1006
     * @param integer $productId The product ID of the stock status to load
1007
     * @param integer $websiteId The website ID of the stock status to load
1008
     * @param integer $stockId   The stock ID of the stock status to load
1009
     *
1010
     * @return array The stock status
1011
     */
1012
    public function loadStockStatus($productId, $websiteId, $stockId)
1013
    {
1014
        return $this->getStockStatusRepository()->findOneByProductIdAndWebsiteIdAndStockId($productId, $websiteId, $stockId);
1015
    }
1016
1017
    /**
1018
     * Load's and return's the stock status with the passed product/website/stock ID.
1019
     *
1020
     * @param integer $productId The product ID of the stock item to load
1021
     * @param integer $websiteId The website ID of the stock item to load
1022
     * @param integer $stockId   The stock ID of the stock item to load
1023
     *
1024
     * @return array The stock item
1025
     */
1026
    public function loadStockItem($productId, $websiteId, $stockId)
1027
    {
1028
        return $this->getStockItemRepository()->findOneByProductIdAndWebsiteIdAndStockId($productId, $websiteId, $stockId);
1029
    }
1030
1031
    /**
1032
     * Load's and return's the varchar attribute with the passed params.
1033
     *
1034
     * @param integer $attributeCode The attribute code of the varchar attribute
1035
     * @param integer $entityTypeId  The entity type ID of the varchar attribute
1036
     * @param integer $storeId       The store ID of the varchar attribute
1037
     * @param string  $value         The value of the varchar attribute
1038
     *
1039
     * @return array|null The varchar attribute
1040
     */
1041
    public function loadProductVarcharAttributeByAttributeCodeAndEntityTypeIdAndStoreIdAndValue($attributeCode, $entityTypeId, $storeId, $value)
1042
    {
1043
        return $this->getProductVarcharRepository()->findOneByAttributeCodeAndEntityTypeIdAndStoreIdAndValue($attributeCode, $entityTypeId, $storeId, $value);
1044
    }
1045
1046
    /**
1047
     * Persist's the passed product data and return's the ID.
1048
     *
1049
     * @param array       $product The product data to persist
1050
     * @param string|null $name    The name of the prepared statement that has to be executed
1051
     *
1052
     * @return string The ID of the persisted entity
1053
     */
1054
    public function persistProduct($product, $name = null)
1055
    {
1056
1057
        // persist the new entity and return the ID
1058
        $id = $this->getProductAction()->persist($product, $name);
0 ignored issues
show
Unused Code introduced by
The call to ProductAction::persist() has too many arguments starting with $name.

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...
1059
1060
        // add the product to the cache, register the SKU reference as well
1061
        $this->getProductRepository()->toCache($product[MemberNames::SKU], $product, array($product[MemberNames::SKU] => $id));
1062
1063
        // return the ID of the persisted product
1064
        return $id;
1065
    }
1066
1067
    /**
1068
     * Persist's the passed product varchar attribute.
1069
     *
1070
     * @param array       $attribute The attribute to persist
1071
     * @param string|null $name      The name of the prepared statement that has to be executed
1072
     *
1073
     * @return void
1074
     */
1075
    public function persistProductVarcharAttribute($attribute, $name = null)
1076
    {
1077
        $this->getProductVarcharAction()->persist($attribute, $name);
0 ignored issues
show
Unused Code introduced by
The call to ProductVarcharAction::persist() has too many arguments starting with $name.

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...
1078
    }
1079
1080
    /**
1081
     * Persist's the passed product integer attribute.
1082
     *
1083
     * @param array       $attribute The attribute to persist
1084
     * @param string|null $name      The name of the prepared statement that has to be executed
1085
     *
1086
     * @return void
1087
     */
1088
    public function persistProductIntAttribute($attribute, $name = null)
1089
    {
1090
        $this->getProductIntAction()->persist($attribute, $name);
0 ignored issues
show
Unused Code introduced by
The call to ProductIntAction::persist() has too many arguments starting with $name.

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...
1091
    }
1092
1093
    /**
1094
     * Persist's the passed product decimal attribute.
1095
     *
1096
     * @param array       $attribute The attribute to persist
1097
     * @param string|null $name      The name of the prepared statement that has to be executed
1098
     *
1099
     * @return void
1100
     */
1101
    public function persistProductDecimalAttribute($attribute, $name = null)
1102
    {
1103
        $this->getProductDecimalAction()->persist($attribute, $name);
0 ignored issues
show
Unused Code introduced by
The call to ProductDecimalAction::persist() has too many arguments starting with $name.

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...
1104
    }
1105
1106
    /**
1107
     * Persist's the passed product datetime attribute.
1108
     *
1109
     * @param array       $attribute The attribute to persist
1110
     * @param string|null $name      The name of the prepared statement that has to be executed
1111
     *
1112
     * @return void
1113
     */
1114
    public function persistProductDatetimeAttribute($attribute, $name = null)
1115
    {
1116
        $this->getProductDatetimeAction()->persist($attribute, $name);
0 ignored issues
show
Unused Code introduced by
The call to ProductDatetimeAction::persist() has too many arguments starting with $name.

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...
1117
    }
1118
1119
    /**
1120
     * Persist's the passed product text attribute.
1121
     *
1122
     * @param array       $attribute The attribute to persist
1123
     * @param string|null $name      The name of the prepared statement that has to be executed
1124
     *
1125
     * @return void
1126
     */
1127
    public function persistProductTextAttribute($attribute, $name = null)
1128
    {
1129
        $this->getProductTextAction()->persist($attribute, $name);
0 ignored issues
show
Unused Code introduced by
The call to ProductTextAction::persist() has too many arguments starting with $name.

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...
1130
    }
1131
1132
    /**
1133
     * Persist's the passed product website data and return's the ID.
1134
     *
1135
     * @param array       $productWebsite The product website data to persist
1136
     * @param string|null $name           The name of the prepared statement that has to be executed
1137
     *
1138
     * @return void
1139
     */
1140
    public function persistProductWebsite($productWebsite, $name = null)
1141
    {
1142
        $this->getProductWebsiteAction()->persist($productWebsite, $name);
0 ignored issues
show
Unused Code introduced by
The call to ProductWebsiteAction::persist() has too many arguments starting with $name.

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...
1143
    }
1144
1145
    /**
1146
     * Persist's the passed category product relation.
1147
     *
1148
     * @param array       $categoryProduct The category product relation to persist
1149
     * @param string|null $name            The name of the prepared statement that has to be executed
1150
     *
1151
     * @return void
1152
     */
1153
    public function persistCategoryProduct($categoryProduct, $name = null)
1154
    {
1155
        $this->getCategoryProductAction()->persist($categoryProduct, $name);
0 ignored issues
show
Unused Code introduced by
The call to CategoryProductAction::persist() has too many arguments starting with $name.

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...
1156
    }
1157
1158
    /**
1159
     * Persist's the passed stock item data and return's the ID.
1160
     *
1161
     * @param array       $stockItem The stock item data to persist
1162
     * @param string|null $name      The name of the prepared statement that has to be executed
1163
     *
1164
     * @return void
1165
     */
1166
    public function persistStockItem($stockItem, $name = null)
1167
    {
1168
        $this->getStockItemAction()->persist($stockItem, $name);
0 ignored issues
show
Unused Code introduced by
The call to StockItemAction::persist() has too many arguments starting with $name.

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...
1169
    }
1170
1171
    /**
1172
     * Persist's the passed stock status data and return's the ID.
1173
     *
1174
     * @param array       $stockStatus The stock status data to persist
1175
     * @param string|null $name        The name of the prepared statement that has to be executed
1176
     *
1177
     * @return void
1178
     */
1179
    public function persistStockStatus($stockStatus, $name = null)
1180
    {
1181
        $this->getStockStatusAction()->persist($stockStatus, $name);
0 ignored issues
show
Unused Code introduced by
The call to StockStatusAction::persist() has too many arguments starting with $name.

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...
1182
    }
1183
1184
    /**
1185
     * Delete's the entity with the passed attributes.
1186
     *
1187
     * @param array       $row  The attributes of the entity to delete
1188
     * @param string|null $name The name of the prepared statement that has to be executed
1189
     *
1190
     * @return void
1191
     */
1192
    public function deleteProduct($row, $name = null)
1193
    {
1194
        $this->getProductAction()->delete($row, $name);
1195
    }
1196
1197
    /**
1198
     * Delete's the URL rewrite with the passed attributes.
1199
     *
1200
     * @param array       $row  The attributes of the entity to delete
1201
     * @param string|null $name The name of the prepared statement that has to be executed
1202
     *
1203
     * @return void
1204
     */
1205
    public function deleteUrlRewrite($row, $name = null)
1206
    {
1207
        $this->getUrlRewriteAction()->delete($row, $name);
1208
    }
1209
1210
    /**
1211
     * Delete's the stock item(s) with the passed attributes.
1212
     *
1213
     * @param array       $row  The attributes of the entity to delete
1214
     * @param string|null $name The name of the prepared statement that has to be executed
1215
     *
1216
     * @return void
1217
     */
1218
    public function deleteStockItem($row, $name = null)
1219
    {
1220
        $this->getStockItemAction()->delete($row, $name);
1221
    }
1222
1223
    /**
1224
     * Delete's the stock status with the passed attributes.
1225
     *
1226
     * @param array       $row  The attributes of the entity to delete
1227
     * @param string|null $name The name of the prepared statement that has to be executed
1228
     *
1229
     * @return void
1230
     */
1231
    public function deleteStockStatus($row, $name = null)
1232
    {
1233
        $this->getStockStatusAction()->delete($row, $name);
1234
    }
1235
1236
    /**
1237
     * Delete's the product website relations with the passed attributes.
1238
     *
1239
     * @param array       $row  The attributes of the entity to delete
1240
     * @param string|null $name The name of the prepared statement that has to be executed
1241
     *
1242
     * @return void
1243
     */
1244
    public function deleteProductWebsite($row, $name = null)
1245
    {
1246
        $this->getProductWebsiteAction()->delete($row, $name);
1247
    }
1248
1249
    /**
1250
     * Delete's the category product relations with the passed attributes.
1251
     *
1252
     * @param array       $row  The attributes of the entity to delete
1253
     * @param string|null $name The name of the prepared statement that has to be executed
1254
     *
1255
     * @return void
1256
     */
1257
    public function deleteCategoryProduct($row, $name = null)
1258
    {
1259
        $this->getCategoryProductAction()->delete($row, $name);
1260
    }
1261
1262
    /**
1263
     * Delete's the product datetime attribute with the passed attributes.
1264
     *
1265
     * @param array       $row  The attributes of the entity to delete
1266
     * @param string|null $name The name of the prepared statement that has to be executed
1267
     *
1268
     * @return void
1269
     */
1270
    public function deleteProductDatetimeAttribute($row, $name = null)
1271
    {
1272
        $this->getProductDatetimeAction()->delete($row, $name);
1273
    }
1274
1275
    /**
1276
     * Delete's the product decimal attribute with the passed attributes.
1277
     *
1278
     * @param array       $row  The attributes of the entity to delete
1279
     * @param string|null $name The name of the prepared statement that has to be executed
1280
     *
1281
     * @return void
1282
     */
1283
    public function deleteProductDecimalAttribute($row, $name = null)
1284
    {
1285
        $this->getProductDecimalAction()->delete($row, $name);
1286
    }
1287
1288
    /**
1289
     * Delete's the product integer attribute with the passed attributes.
1290
     *
1291
     * @param array       $row  The attributes of the entity to delete
1292
     * @param string|null $name The name of the prepared statement that has to be executed
1293
     *
1294
     * @return void
1295
     */
1296
    public function deleteProductIntAttribute($row, $name = null)
1297
    {
1298
        $this->getProductIntAction()->delete($row, $name);
1299
    }
1300
1301
    /**
1302
     * Delete's the product text attribute with the passed attributes.
1303
     *
1304
     * @param array       $row  The attributes of the entity to delete
1305
     * @param string|null $name The name of the prepared statement that has to be executed
1306
     *
1307
     * @return void
1308
     */
1309
    public function deleteProductTextAttribute($row, $name = null)
1310
    {
1311
        $this->getProductTextAction()->delete($row, $name);
1312
    }
1313
1314
    /**
1315
     * Delete's the product varchar attribute with the passed attributes.
1316
     *
1317
     * @param array       $row  The attributes of the entity to delete
1318
     * @param string|null $name The name of the prepared statement that has to be executed
1319
     *
1320
     * @return void
1321
     */
1322
    public function deleteProductVarcharAttribute($row, $name = null)
1323
    {
1324
        $this->getProductVarcharAction()->delete($row, $name);
1325
    }
1326
1327
    /**
1328
     * Clean-Up the repositories to free memory.
1329
     *
1330
     * @return void
1331
     */
1332
    public function cleanUp()
1333
    {
1334
        $this->getProductRepository()->flushCache();
1335
    }
1336
}
1337