Completed
Push — master ( 41575c...8e6477 )
by Tim
14s
created

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

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
1030
    }
1031
1032
    /**
1033
     * Return's an array with the URL rewrites for the passed SKU.
1034
     *
1035
     * @param string $sku The SKU to load the URL rewrites for
1036
     *
1037
     * @return array The URL rewrites
1038
     */
1039
    public function getUrlRewritesBySku($sku)
1040
    {
1041
        return $this->getUrlRewriteRepository()->findAllBySku($sku);
1042
    }
1043
1044
    /**
1045
     * Return's an array with the URL rewrite product category relations for the passed SKU.
1046
     *
1047
     * @param string $sku The SKU to load the URL rewrite product category relations for
1048
     *
1049
     * @return array The URL rewrite product category relations
1050
     */
1051
    public function getUrlRewriteProductCategoriesBySku($sku)
1052
    {
1053
        return $this->getUrlRewriteProductCategoryRepository()->findAllBySku($sku);
1054
    }
1055
1056
    /**
1057
     * Load's and return's the product with the passed SKU.
1058
     *
1059
     * @param string $sku The SKU of the product to load
1060
     *
1061
     * @return array The product
1062
     */
1063
    public function loadProduct($sku)
1064
    {
1065
        return $this->getProductRepository()->findOneBySku($sku);
1066
    }
1067
1068
    /**
1069
     * Load's and return's the product website relation with the passed product and website ID.
1070
     *
1071
     * @param string $productId The product ID of the relation
1072
     * @param string $websiteId The website ID of the relation
1073
     *
1074
     * @return array The product website
1075
     */
1076
    public function loadProductWebsite($productId, $websiteId)
1077
    {
1078
        return $this->getProductWebsiteRepository()->findOneByProductIdAndWebsite($productId, $websiteId);
1079
    }
1080
1081
    /**
1082
     * Return's the category product relation with the passed category/product ID.
1083
     *
1084
     * @param integer $categoryId The category ID of the category product relation to return
1085
     * @param integer $productId  The product ID of the category product relation to return
1086
     *
1087
     * @return array The category product relation
1088
     */
1089
    public function loadCategoryProduct($categoryId, $productId)
1090
    {
1091
        return $this->getCategoryProductRepository()->findOneByCategoryIdAndProductId($categoryId, $productId);
1092
    }
1093
1094
    /**
1095
     * Load's and return's the stock status with the passed product/website/stock ID.
1096
     *
1097
     * @param integer $productId The product ID of the stock status to load
1098
     * @param integer $websiteId The website ID of the stock status to load
1099
     * @param integer $stockId   The stock ID of the stock status to load
1100
     *
1101
     * @return array The stock status
1102
     */
1103
    public function loadStockStatus($productId, $websiteId, $stockId)
1104
    {
1105
        return $this->getStockStatusRepository()->findOneByProductIdAndWebsiteIdAndStockId($productId, $websiteId, $stockId);
1106
    }
1107
1108
    /**
1109
     * Load's and return's the stock status with the passed product/website/stock ID.
1110
     *
1111
     * @param integer $productId The product ID of the stock item to load
1112
     * @param integer $websiteId The website ID of the stock item to load
1113
     * @param integer $stockId   The stock ID of the stock item to load
1114
     *
1115
     * @return array The stock item
1116
     */
1117
    public function loadStockItem($productId, $websiteId, $stockId)
1118
    {
1119
        return $this->getStockItemRepository()->findOneByProductIdAndWebsiteIdAndStockId($productId, $websiteId, $stockId);
1120
    }
1121
1122
    /**
1123
     * Load's and return's the datetime attribute with the passed entity/attribute/store ID.
1124
     *
1125
     * @param integer $entityId    The entity ID of the attribute
1126
     * @param integer $attributeId The attribute ID of the attribute
1127
     * @param integer $storeId     The store ID of the attribute
1128
     *
1129
     * @return array|null The datetime attribute
1130
     */
1131
    public function loadProductDatetimeAttribute($entityId, $attributeId, $storeId)
1132
    {
1133
        return  $this->getProductDatetimeRepository()->findOneByEntityIdAndAttributeIdAndStoreId($entityId, $attributeId, $storeId);
1134
    }
1135
1136
    /**
1137
     * Load's and return's the decimal attribute with the passed entity/attribute/store ID.
1138
     *
1139
     * @param integer $entityId    The entity ID of the attribute
1140
     * @param integer $attributeId The attribute ID of the attribute
1141
     * @param integer $storeId     The store ID of the attribute
1142
     *
1143
     * @return array|null The decimal attribute
1144
     */
1145
    public function loadProductDecimalAttribute($entityId, $attributeId, $storeId)
1146
    {
1147
        return  $this->getProductDecimalRepository()->findOneByEntityIdAndAttributeIdAndStoreId($entityId, $attributeId, $storeId);
1148
    }
1149
1150
    /**
1151
     * Load's and return's the integer attribute with the passed entity/attribute/store ID.
1152
     *
1153
     * @param integer $entityId    The entity ID of the attribute
1154
     * @param integer $attributeId The attribute ID of the attribute
1155
     * @param integer $storeId     The store ID of the attribute
1156
     *
1157
     * @return array|null The integer attribute
1158
     */
1159
    public function loadProductIntAttribute($entityId, $attributeId, $storeId)
1160
    {
1161
        return $this->getProductIntRepository()->findOneByEntityIdAndAttributeIdAndStoreId($entityId, $attributeId, $storeId);
1162
    }
1163
1164
    /**
1165
     * Load's and return's the text attribute with the passed entity/attribute/store ID.
1166
     *
1167
     * @param integer $entityId    The entity ID of the attribute
1168
     * @param integer $attributeId The attribute ID of the attribute
1169
     * @param integer $storeId     The store ID of the attribute
1170
     *
1171
     * @return array|null The text attribute
1172
     */
1173
    public function loadProductTextAttribute($entityId, $attributeId, $storeId)
1174
    {
1175
        return $this->getProductTextRepository()->findOneByEntityIdAndAttributeIdAndStoreId($entityId, $attributeId, $storeId);
1176
    }
1177
1178
    /**
1179
     * Load's and return's the varchar attribute with the passed entity/attribute/store ID.
1180
     *
1181
     * @param integer $entityId    The entity ID of the attribute
1182
     * @param integer $attributeId The attribute ID of the attribute
1183
     * @param integer $storeId     The store ID of the attribute
1184
     *
1185
     * @return array|null The varchar attribute
1186
     */
1187
    public function loadProductVarcharAttribute($entityId, $attributeId, $storeId)
1188
    {
1189
        return $this->getProductVarcharRepository()->findOneByEntityIdAndAttributeIdAndStoreId($entityId, $attributeId, $storeId);
1190
    }
1191
1192
    /**
1193
     * Load's and return's the varchar attribute with the passed params.
1194
     *
1195
     * @param integer $attributeCode The attribute code of the varchar attribute
1196
     * @param integer $entityTypeId  The entity type ID of the varchar attribute
1197
     * @param integer $storeId       The store ID of the varchar attribute
1198
     * @param string  $value         The value of the varchar attribute
1199
     *
1200
     * @return array|null The varchar attribute
1201
     */
1202
    public function loadProductVarcharAttributeByAttributeCodeAndEntityTypeIdAndStoreIdAndValue($attributeCode, $entityTypeId, $storeId, $value)
1203
    {
1204
        return $this->getProductVarcharRepository()->findOneByAttributeCodeAndEntityTypeIdAndStoreIdAndValue($attributeCode, $entityTypeId, $storeId, $value);
1205
    }
1206
1207
    /**
1208
     * Return's the URL rewrite product category relation for the passed
1209
     * URL rewrite ID.
1210
     *
1211
     * @param integer $urlRewriteId The URL rewrite ID to load the URL rewrite product category relation for
1212
     *
1213
     * @return array|false The URL rewrite product category relation
1214
     */
1215
    public function loadUrlRewriteProductCategory($urlRewriteId)
1216
    {
1217
        return $this->getUrlRewriteProductCategoryRepository()->load($urlRewriteId);
1218
    }
1219
1220
    /**
1221
     * Persist's the passed product data and return's the ID.
1222
     *
1223
     * @param array       $product The product data to persist
1224
     * @param string|null $name    The name of the prepared statement that has to be executed
1225
     *
1226
     * @return string The ID of the persisted entity
1227
     */
1228
    public function persistProduct($product, $name = null)
1229
    {
1230
        return $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...
1231
    }
1232
1233
    /**
1234
     * Persist's the passed product varchar attribute.
1235
     *
1236
     * @param array       $attribute The attribute to persist
1237
     * @param string|null $name      The name of the prepared statement that has to be executed
1238
     *
1239
     * @return void
1240
     */
1241
    public function persistProductVarcharAttribute($attribute, $name = null)
1242
    {
1243
        $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...
1244
    }
1245
1246
    /**
1247
     * Persist's the passed product integer attribute.
1248
     *
1249
     * @param array       $attribute The attribute to persist
1250
     * @param string|null $name      The name of the prepared statement that has to be executed
1251
     *
1252
     * @return void
1253
     */
1254
    public function persistProductIntAttribute($attribute, $name = null)
1255
    {
1256
        $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...
1257
    }
1258
1259
    /**
1260
     * Persist's the passed product decimal attribute.
1261
     *
1262
     * @param array       $attribute The attribute to persist
1263
     * @param string|null $name      The name of the prepared statement that has to be executed
1264
     *
1265
     * @return void
1266
     */
1267
    public function persistProductDecimalAttribute($attribute, $name = null)
1268
    {
1269
        $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...
1270
    }
1271
1272
    /**
1273
     * Persist's the passed product datetime attribute.
1274
     *
1275
     * @param array       $attribute The attribute to persist
1276
     * @param string|null $name      The name of the prepared statement that has to be executed
1277
     *
1278
     * @return void
1279
     */
1280
    public function persistProductDatetimeAttribute($attribute, $name = null)
1281
    {
1282
        $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...
1283
    }
1284
1285
    /**
1286
     * Persist's the passed product text attribute.
1287
     *
1288
     * @param array       $attribute The attribute to persist
1289
     * @param string|null $name      The name of the prepared statement that has to be executed
1290
     *
1291
     * @return void
1292
     */
1293
    public function persistProductTextAttribute($attribute, $name = null)
1294
    {
1295
        $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...
1296
    }
1297
1298
    /**
1299
     * Persist's the passed product website data and return's the ID.
1300
     *
1301
     * @param array       $productWebsite The product website data to persist
1302
     * @param string|null $name           The name of the prepared statement that has to be executed
1303
     *
1304
     * @return void
1305
     */
1306
    public function persistProductWebsite($productWebsite, $name = null)
1307
    {
1308
        $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...
1309
    }
1310
1311
    /**
1312
     * Persist's the passed category product relation.
1313
     *
1314
     * @param array       $categoryProduct The category product relation to persist
1315
     * @param string|null $name            The name of the prepared statement that has to be executed
1316
     *
1317
     * @return void
1318
     */
1319
    public function persistCategoryProduct($categoryProduct, $name = null)
1320
    {
1321
        $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...
1322
    }
1323
1324
    /**
1325
     * Persist's the passed stock item data and return's the ID.
1326
     *
1327
     * @param array       $stockItem The stock item data to persist
1328
     * @param string|null $name      The name of the prepared statement that has to be executed
1329
     *
1330
     * @return void
1331
     */
1332
    public function persistStockItem($stockItem, $name = null)
1333
    {
1334
        $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...
1335
    }
1336
1337
    /**
1338
     * Persist's the passed stock status data and return's the ID.
1339
     *
1340
     * @param array       $stockStatus The stock status data to persist
1341
     * @param string|null $name        The name of the prepared statement that has to be executed
1342
     *
1343
     * @return void
1344
     */
1345
    public function persistStockStatus($stockStatus, $name = null)
1346
    {
1347
        $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...
1348
    }
1349
1350
    /**
1351
     * Persist's the URL write with the passed data.
1352
     *
1353
     * @param array       $row  The URL rewrite to persist
1354
     * @param string|null $name The name of the prepared statement that has to be executed
1355
     *
1356
     * @return string The ID of the persisted entity
1357
     */
1358
    public function persistUrlRewrite($row, $name = null)
1359
    {
1360
        return $this->getUrlRewriteAction()->persist($row, $name);
0 ignored issues
show
Unused Code introduced by
The call to UrlRewriteAction::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...
1361
    }
1362
1363
    /**
1364
     * Persist's the URL rewrite product => category relation with the passed data.
1365
     *
1366
     * @param array       $row  The URL rewrite product => category relation to persist
1367
     * @param string|null $name The name of the prepared statement that has to be executed
1368
     *
1369
     * @return void
1370
     */
1371
    public function persistUrlRewriteProductCategory($row, $name = null)
1372
    {
1373
        $this->getUrlRewriteProductCategoryAction()->persist($row, $name);
0 ignored issues
show
Unused Code introduced by
The call to UrlRewriteProductCategoryAction::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...
1374
    }
1375
1376
    /**
1377
     * Delete's the entity with the passed attributes.
1378
     *
1379
     * @param array       $row  The attributes of the entity to delete
1380
     * @param string|null $name The name of the prepared statement that has to be executed
1381
     *
1382
     * @return void
1383
     */
1384
    public function deleteProduct($row, $name = null)
1385
    {
1386
        $this->getProductAction()->delete($row, $name);
1387
    }
1388
1389
    /**
1390
     * Delete's the URL rewrite with the passed attributes.
1391
     *
1392
     * @param array       $row  The attributes of the entity to delete
1393
     * @param string|null $name The name of the prepared statement that has to be executed
1394
     *
1395
     * @return void
1396
     */
1397
    public function deleteUrlRewrite($row, $name = null)
1398
    {
1399
        $this->getUrlRewriteAction()->delete($row, $name);
1400
    }
1401
1402
    /**
1403
     * Delete's the stock item(s) with the passed attributes.
1404
     *
1405
     * @param array       $row  The attributes of the entity to delete
1406
     * @param string|null $name The name of the prepared statement that has to be executed
1407
     *
1408
     * @return void
1409
     */
1410
    public function deleteStockItem($row, $name = null)
1411
    {
1412
        $this->getStockItemAction()->delete($row, $name);
1413
    }
1414
1415
    /**
1416
     * Delete's the stock status with the passed attributes.
1417
     *
1418
     * @param array       $row  The attributes of the entity to delete
1419
     * @param string|null $name The name of the prepared statement that has to be executed
1420
     *
1421
     * @return void
1422
     */
1423
    public function deleteStockStatus($row, $name = null)
1424
    {
1425
        $this->getStockStatusAction()->delete($row, $name);
1426
    }
1427
1428
    /**
1429
     * Delete's the product website relations with the passed attributes.
1430
     *
1431
     * @param array       $row  The attributes of the entity to delete
1432
     * @param string|null $name The name of the prepared statement that has to be executed
1433
     *
1434
     * @return void
1435
     */
1436
    public function deleteProductWebsite($row, $name = null)
1437
    {
1438
        $this->getProductWebsiteAction()->delete($row, $name);
1439
    }
1440
1441
    /**
1442
     * Delete's the category product relations with the passed attributes.
1443
     *
1444
     * @param array       $row  The attributes of the entity to delete
1445
     * @param string|null $name The name of the prepared statement that has to be executed
1446
     *
1447
     * @return void
1448
     */
1449
    public function deleteCategoryProduct($row, $name = null)
1450
    {
1451
        $this->getCategoryProductAction()->delete($row, $name);
1452
    }
1453
}
1454