Completed
Push — master ( 4dbc66...04642e )
by Tim
11s
created

ProductBunchProcessor::setStockItemRepository()   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
c 0
b 0
f 0
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\Repositories\UrlRewriteRepository;
25
use TechDivision\Import\Product\Repositories\ProductRepository;
26
use TechDivision\Import\Product\Repositories\ProductWebsiteRepository;
27
use TechDivision\Import\Product\Repositories\ProductDatetimeRepository;
28
use TechDivision\Import\Product\Repositories\ProductDecimalRepository;
29
use TechDivision\Import\Product\Repositories\ProductIntRepository;
30
use TechDivision\Import\Product\Repositories\ProductTextRepository;
31
use TechDivision\Import\Product\Repositories\ProductVarcharRepository;
32
use TechDivision\Import\Product\Repositories\CategoryProductRepository;
33
use TechDivision\Import\Product\Repositories\StockStatusRepository;
34
use TechDivision\Import\Product\Repositories\StockItemRepository;
35
use TechDivision\Import\Product\Repositories\UrlRewriteProductCategoryRepository;
36
use TechDivision\Import\Repositories\EavAttributeOptionValueRepository;
37
use TechDivision\Import\Repositories\EavAttributeRepository;
38
use TechDivision\Import\Product\Actions\CategoryProductAction;
39
use TechDivision\Import\Product\Actions\ProductDatetimeAction;
40
use TechDivision\Import\Product\Actions\ProductDecimalAction;
41
use TechDivision\Import\Product\Actions\ProductIntAction;
42
use TechDivision\Import\Product\Actions\ProductAction;
43
use TechDivision\Import\Product\Actions\ProductTextAction;
44
use TechDivision\Import\Product\Actions\ProductVarcharAction;
45
use TechDivision\Import\Product\Actions\ProductWebsiteAction;
46
use TechDivision\Import\Product\Actions\StockItemAction;
47
use TechDivision\Import\Product\Actions\StockStatusAction;
48
use TechDivision\Import\Product\Actions\UrlRewriteProductCategoryAction;
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 \PDO
66
     */
67
    protected $connection;
68
69
    /**
70
     * The repository to access EAV attribute option values.
71
     *
72
     * @var \TechDivision\Import\Product\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 action for URL rewrite product category CRUD methods.
162
     *
163
     * @var \TechDivision\Import\Product\Actions\UrlRewriteProductCategoryAction
164
     */
165
    protected $urlRewriteProductCategoryAction;
166
167
    /**
168
     * The repository to load the products with.
169
     *
170
     * @var \TechDivision\Import\Product\Repositories\ProductRepository
171
     */
172
    protected $productRepository;
173
174
    /**
175
     * The repository to load the product website relations with.
176
     *
177
     * @var \TechDivision\Import\Product\Repositories\ProductWebsiteRepository
178
     */
179
    protected $productWebsiteRepository;
180
181
    /**
182
     * The repository to load the product datetime attribute with.
183
     *
184
     * @var \TechDivision\Import\Product\Repositories\ProductDatetimeRepository
185
     */
186
    protected $productDatetimeRepository;
187
188
    /**
189
     * The repository to load the product decimal attribute with.
190
     *
191
     * @var \TechDivision\Import\Product\Repositories\ProductDecimalRepository
192
     */
193
    protected $productDecimalRepository;
194
195
    /**
196
     * The repository to load the product integer attribute with.
197
     *
198
     * @var \TechDivision\Import\Product\Repositories\ProductIntRepository
199
     */
200
    protected $productIntRepository;
201
202
    /**
203
     * The repository to load the product text attribute with.
204
     *
205
     * @var \TechDivision\Import\Product\Repositories\ProductTextRepository
206
     */
207
    protected $productTextRepository;
208
209
    /**
210
     * The repository to load the product varchar attribute with.
211
     *
212
     * @var \TechDivision\Import\Product\Repositories\ProductVarcharRepository
213
     */
214
    protected $productVarcharRepository;
215
216
    /**
217
     * The repository to load the category product relations with.
218
     *
219
     * @var \TechDivision\Import\Product\Repositories\CategoryProductRepository
220
     */
221
    protected $categoryProductRepository;
222
223
    /**
224
     * The repository to load the stock status with.
225
     *
226
     * @var \TechDivision\Import\Product\Repositories\StockStatusRepository
227
     */
228
    protected $stockStatusRepository;
229
230
    /**
231
     * The repository to load the stock item with.
232
     *
233
     * @var \TechDivision\Import\Product\Repositories\StockItemRepository
234
     */
235
    protected $stockItemRepository;
236
237
    /**
238
     * The repository to load the URL rewrites with.
239
     *
240
     * @var \TechDivision\Import\Repositories\UrlRewriteRepository
241
     */
242
    protected $urlRewriteRepository;
243
244
    /**
245
     * The repository to load the URL rewrite product category relations with.
246
     *
247
     * @var \TechDivision\Import\Product\Repositories\UrlRewriteProductCategoryRepository
248
     */
249
    protected $urlRewriteProductCategoryRepository;
250
251
    /**
252
     * Initialize the processor with the necessary assembler and repository instances.
253
     *
254
     * @param \PDO                                                                        $connection                          The PDO connection to use
255
     * @param \TechDivision\Import\Product\Repositories\ProductRepository                 $productRepository                   The product repository to use
256
     * @param \TechDivision\Import\Product\Repositories\ProductWebsiteRepository          $productWebsiteRepository            The product website repository to use
257
     * @param \TechDivision\Import\Product\Repositories\ProductDatetimeRepository         $productDatetimeRepository           The product datetime repository to use
258
     * @param \TechDivision\Import\Product\Repositories\ProductDecimalRepository          $productDecimalRepository            The product decimal repository to use
259
     * @param \TechDivision\Import\Product\Repositories\ProductIntRepository              $productIntRepository                The product integer repository to use
260
     * @param \TechDivision\Import\Product\Repositories\ProductTextRepository             $productTextRepository               The product text repository to use
261
     * @param \TechDivision\Import\Product\Repositories\ProductVarcharRepository          $productVarcharRepository            The product varchar repository to use
262
     * @param \TechDivision\Import\Product\Repositories\CategoryProductRepository         $categoryProductRepository           The category product repository to use
263
     * @param \TechDivision\Import\Product\Repositories\StockStatusRepository             $stockStatusRepository               The stock status repository to use
264
     * @param \TechDivision\Import\Product\Repositories\StockItemRepository               $stockItemRepository                 The stock item repository to use
265
     * @param \TechDivision\Import\Repositories\UrlRewriteRepository                      $urlRewriteRepository                The URL rewrite repository to use
266
     * @param \TechDivision\Import\Repositories\UrlRewriteRepository                      $urlRewriteProductCategoryRepository The URL rewrite product category repository to use
267
     * @param \TechDivision\Import\Product\Repositories\EavAttributeOptionValueRepository $eavAttributeOptionValueRepository   The EAV attribute option value repository to use
268
     * @param \TechDivision\Import\Repositories\EavAttributeRepository                    $eavAttributeRepository              The EAV attribute repository to use
269
     * @param \TechDivision\Import\Product\Actions\CategoryProductAction                  $categoryProductAction               The category product action to use
270
     * @param \TechDivision\Import\Product\Actions\ProductDatetimeAction                  $productDatetimeAction               The product datetime action to use
271
     * @param \TechDivision\Import\Product\Actions\ProductDecimalAction                   $productDecimalAction                The product decimal action to use
272
     * @param \TechDivision\Import\Product\Actions\ProductIntAction                       $productIntAction                    The product integer action to use
273
     * @param \TechDivision\Import\Product\Actions\ProductAction                          $productAction                       The product action to use
274
     * @param \TechDivision\Import\Product\Actions\ProductTextAction                      $productTextAction                   The product text action to use
275
     * @param \TechDivision\Import\Product\Actions\ProductVarcharAction                   $productVarcharAction                The product varchar action to use
276
     * @param \TechDivision\Import\Product\Actions\ProductWebsiteAction                   $productWebsiteAction                The product website action to use
277
     * @param \TechDivision\Import\Product\Actions\StockItemAction                        $stockItemAction                     The stock item action to use
278
     * @param \TechDivision\Import\Product\Actions\StockStatusAction                      $stockStatusAction                   The stock status action to use
279
     * @param \TechDivision\Import\Actions\UrlRewriteAction                               $urlRewriteAction                    The URL rewrite action to use
280
     * @param \TechDivision\Import\Product\Actions\UrlRewriteProductCategoryAction        $urlRewriteProductCategoryAction     The URL rewrite product category action to use
281
     */
282
    public function __construct(
283
        \PDO $connection,
284
        ProductRepository $productRepository,
285
        ProductWebsiteRepository $productWebsiteRepository,
286
        ProductDatetimeRepository $productDatetimeRepository,
287
        ProductDecimalRepository $productDecimalRepository,
288
        ProductIntRepository $productIntRepository,
289
        ProductTextRepository $productTextRepository,
290
        ProductVarcharRepository $productVarcharRepository,
291
        CategoryProductRepository $categoryProductRepository,
292
        StockStatusRepository $stockStatusRepository,
293
        StockItemRepository $stockItemRepository,
294
        UrlRewriteRepository $urlRewriteRepository,
295
        UrlRewriteProductCategoryRepository $urlRewriteProductCategoryRepository,
296
        EavAttributeOptionValueRepository $eavAttributeOptionValueRepository,
297
        EavAttributeRepository $eavAttributeRepository,
298
        CategoryProductAction $categoryProductAction,
299
        ProductDatetimeAction $productDatetimeAction,
300
        ProductDecimalAction $productDecimalAction,
301
        ProductIntAction $productIntAction,
302
        ProductAction $productAction,
303
        ProductTextAction $productTextAction,
304
        ProductVarcharAction $productVarcharAction,
305
        ProductWebsiteAction $productWebsiteAction,
306
        StockItemAction $stockItemAction,
307
        StockStatusAction $stockStatusAction,
308
        UrlRewriteAction $urlRewriteAction,
309
        UrlRewriteProductCategoryAction $urlRewriteProductCategoryAction
310
    ) {
311
        $this->setConnection($connection);
312
        $this->setProductRepository($productRepository);
313
        $this->setProductWebsiteRepository($productWebsiteRepository);
314
        $this->setProductDatetimeRepository($productDatetimeRepository);
315
        $this->setProductDecimalRepository($productDecimalRepository);
316
        $this->setProductIntRepository($productIntRepository);
317
        $this->setProductTextRepository($productTextRepository);
318
        $this->setProductVarcharRepository($productVarcharRepository);
319
        $this->setCategoryProductRepository($categoryProductRepository);
320
        $this->setStockStatusRepository($stockStatusRepository);
321
        $this->setStockItemRepository($stockItemRepository);
322
        $this->setUrlRewriteRepository($urlRewriteRepository);
323
        $this->setUrlRewriteProductCategoryRepository($urlRewriteProductCategoryRepository);
324
        $this->setEavAttributeOptionValueRepository($eavAttributeOptionValueRepository);
0 ignored issues
show
Documentation introduced by
$eavAttributeOptionValueRepository is of type object<TechDivision\Impo...eOptionValueRepository>, but the function expects a object<TechDivision\Impo...eOptionValueRepository>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
325
        $this->setEavAttributeRepository($eavAttributeRepository);
326
        $this->setCategoryProductAction($categoryProductAction);
0 ignored issues
show
Documentation introduced by
$categoryProductAction is of type object<TechDivision\Impo...\CategoryProductAction>, but the function expects a object<TechDivision\Impo...\ProductCategoryAction>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
327
        $this->setProductDatetimeAction($productDatetimeAction);
328
        $this->setProductDecimalAction($productDecimalAction);
329
        $this->setProductIntAction($productIntAction);
330
        $this->setProductAction($productAction);
331
        $this->setProductTextAction($productTextAction);
332
        $this->setProductVarcharAction($productVarcharAction);
333
        $this->setProductWebsiteAction($productWebsiteAction);
334
        $this->setStockItemAction($stockItemAction);
335
        $this->setStockStatusAction($stockStatusAction);
336
        $this->setUrlRewriteAction($urlRewriteAction);
337
        $this->setUrlRewriteProductCategoryAction($urlRewriteProductCategoryAction);
0 ignored issues
show
Documentation introduced by
$urlRewriteProductCategoryAction is of type object<TechDivision\Impo...eProductCategoryAction>, but the function expects a object<TechDivision\Impo...tions\UrlRewriteAction>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
338
    }
339
340
    /**
341
     * Set's the passed connection.
342
     *
343
     * @param \PDO $connection The connection to set
344
     *
345
     * @return void
346
     */
347
    public function setConnection(\PDO $connection)
348
    {
349
        $this->connection = $connection;
350
    }
351
352
    /**
353
     * Return's the connection.
354
     *
355
     * @return \PDO The connection instance
356
     */
357
    public function getConnection()
358
    {
359
        return $this->connection;
360
    }
361
362
    /**
363
     * Turns off autocommit mode. While autocommit mode is turned off, changes made to the database via the PDO
364
     * object instance are not committed until you end the transaction by calling ProductProcessor::commit().
365
     * Calling ProductProcessor::rollBack() will roll back all changes to the database and return the connection
366
     * to autocommit mode.
367
     *
368
     * @return boolean Returns TRUE on success or FALSE on failure
369
     * @link http://php.net/manual/en/pdo.begintransaction.php
370
     */
371
    public function beginTransaction()
372
    {
373
        return $this->connection->beginTransaction();
374
    }
375
376
    /**
377
     * Commits a transaction, returning the database connection to autocommit mode until the next call to
378
     * ProductProcessor::beginTransaction() starts a new transaction.
379
     *
380
     * @return boolean Returns TRUE on success or FALSE on failure
381
     * @link http://php.net/manual/en/pdo.commit.php
382
     */
383
    public function commit()
384
    {
385
        return $this->connection->commit();
386
    }
387
388
    /**
389
     * Rolls back the current transaction, as initiated by ProductProcessor::beginTransaction().
390
     *
391
     * If the database was set to autocommit mode, this function will restore autocommit mode after it has
392
     * rolled back the transaction.
393
     *
394
     * Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition
395
     * language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit
396
     * COMMIT will prevent you from rolling back any other changes within the transaction boundary.
397
     *
398
     * @return boolean Returns TRUE on success or FALSE on failure
399
     * @link http://php.net/manual/en/pdo.rollback.php
400
     */
401
    public function rollBack()
402
    {
403
        return $this->connection->rollBack();
404
    }
405
406
    /**
407
     * Set's the repository to access EAV attribute option values.
408
     *
409
     * @param \TechDivision\Import\Product\Repositories\EavAttributeOptionValueRepository $eavAttributeOptionValueRepository The repository to access EAV attribute option values
410
     *
411
     * @return void
412
     */
413
    public function setEavAttributeOptionValueRepository($eavAttributeOptionValueRepository)
414
    {
415
        $this->eavAttributeOptionValueRepository = $eavAttributeOptionValueRepository;
416
    }
417
418
    /**
419
     * Return's the repository to access EAV attribute option values.
420
     *
421
     * @return \TechDivision\Import\Product\Repositories\EavAttributeOptionValueRepository The repository instance
422
     */
423
    public function getEavAttributeOptionValueRepository()
424
    {
425
        return $this->eavAttributeOptionValueRepository;
426
    }
427
428
    /**
429
     * Set's the repository to access EAV attributes.
430
     *
431
     * @param \TechDivision\Import\Repositories\EavAttributeRepository $eavAttributeRepository The repository to access EAV attributes
432
     *
433
     * @return void
434
     */
435
    public function setEavAttributeRepository($eavAttributeRepository)
436
    {
437
        $this->eavAttributeRepository = $eavAttributeRepository;
438
    }
439
440
    /**
441
     * Return's the repository to access EAV attributes.
442
     *
443
     * @return \TechDivision\Import\Repositories\EavAttributeRepository The repository instance
444
     */
445
    public function getEavAttributeRepository()
446
    {
447
        return $this->eavAttributeRepository;
448
    }
449
450
    /**
451
     * Return's an array with the available EAV attributes for the passed is user defined flag.
452
     *
453
     * @param integer $isUserDefined The flag itself
454
     *
455
     * @return array The array with the EAV attributes matching the passed flag
456
     */
457
    public function getEavAttributeByIsUserDefined($isUserDefined = 1)
458
    {
459
        return $this->getEavAttributeRepository()->findAllByIsUserDefined($isUserDefined);
460
    }
461
462
    /**
463
     * Set's the action with the product CRUD methods.
464
     *
465
     * @param \TechDivision\Import\Product\Actions\ProductAction $productAction The action with the product CRUD methods
466
     *
467
     * @return void
468
     */
469
    public function setProductAction($productAction)
470
    {
471
        $this->productAction = $productAction;
472
    }
473
474
    /**
475
     * Return's the action with the product CRUD methods.
476
     *
477
     * @return \TechDivision\Import\Product\Actions\ProductAction The action instance
478
     */
479
    public function getProductAction()
480
    {
481
        return $this->productAction;
482
    }
483
484
    /**
485
     * Set's the action with the product varchar attribute CRUD methods.
486
     *
487
     * @param \TechDivision\Import\Product\Actions\ProductVarcharAction $productVarcharAction The action with the product varchar attriute CRUD methods
488
     *
489
     * @return void
490
     */
491
    public function setProductVarcharAction($productVarcharAction)
492
    {
493
        $this->productVarcharAction = $productVarcharAction;
494
    }
495
496
    /**
497
     * Return's the action with the product varchar attribute CRUD methods.
498
     *
499
     * @return \TechDivision\Import\Product\Actions\ProductVarcharAction The action instance
500
     */
501
    public function getProductVarcharAction()
502
    {
503
        return $this->productVarcharAction;
504
    }
505
506
    /**
507
     * Set's the action with the product text attribute CRUD methods.
508
     *
509
     * @param \TechDivision\Import\Product\Actions\ProductTextAction $productTextAction The action with the product text attriute CRUD methods
510
     *
511
     * @return void
512
     */
513
    public function setProductTextAction($productTextAction)
514
    {
515
        $this->productTextAction = $productTextAction;
516
    }
517
518
    /**
519
     * Return's the action with the product text attribute CRUD methods.
520
     *
521
     * @return \TechDivision\Import\Product\Actions\ProductTextAction The action instance
522
     */
523
    public function getProductTextAction()
524
    {
525
        return $this->productTextAction;
526
    }
527
528
    /**
529
     * Set's the action with the product int attribute CRUD methods.
530
     *
531
     * @param \TechDivision\Import\Product\Actions\ProductIntAction $productIntAction The action with the product int attriute CRUD methods
532
     *
533
     * @return void
534
     */
535
    public function setProductIntAction($productIntAction)
536
    {
537
        $this->productIntAction = $productIntAction;
538
    }
539
540
    /**
541
     * Return's the action with the product int attribute CRUD methods.
542
     *
543
     * @return \TechDivision\Import\Product\Actions\ProductIntAction The action instance
544
     */
545
    public function getProductIntAction()
546
    {
547
        return $this->productIntAction;
548
    }
549
550
    /**
551
     * Set's the action with the product decimal attribute CRUD methods.
552
     *
553
     * @param \TechDivision\Import\Product\Actions\ProductDecimalAction $productDecimalAction The action with the product decimal attriute CRUD methods
554
     *
555
     * @return void
556
     */
557
    public function setProductDecimalAction($productDecimalAction)
558
    {
559
        $this->productDecimalAction = $productDecimalAction;
560
    }
561
562
    /**
563
     * Return's the action with the product decimal attribute CRUD methods.
564
     *
565
     * @return \TechDivision\Import\Product\Actions\ProductDecimalAction The action instance
566
     */
567
    public function getProductDecimalAction()
568
    {
569
        return $this->productDecimalAction;
570
    }
571
572
    /**
573
     * Set's the action with the product datetime attribute CRUD methods.
574
     *
575
     * @param \TechDivision\Import\Product\Actions\ProductDatetimeAction $productDatetimeAction The action with the product datetime attriute CRUD methods
576
     *
577
     * @return void
578
     */
579
    public function setProductDatetimeAction($productDatetimeAction)
580
    {
581
        $this->productDatetimeAction = $productDatetimeAction;
582
    }
583
584
    /**
585
     * Return's the action with the product datetime attribute CRUD methods.
586
     *
587
     * @return \TechDivision\Import\Product\Actions\ProductDatetimeAction The action instance
588
     */
589
    public function getProductDatetimeAction()
590
    {
591
        return $this->productDatetimeAction;
592
    }
593
594
    /**
595
     * Set's the action with the product website CRUD methods.
596
     *
597
     * @param \TechDivision\Import\Product\Actions\ProductWebsiteAction $productWebsiteAction The action with the product website CRUD methods
598
     *
599
     * @return void
600
     */
601
    public function setProductWebsiteAction($productWebsiteAction)
602
    {
603
        $this->productWebsiteAction = $productWebsiteAction;
604
    }
605
606
    /**
607
     * Return's the action with the product website CRUD methods.
608
     *
609
     * @return \TechDivision\Import\Product\Actions\ProductWebsiteAction The action instance
610
     */
611
    public function getProductWebsiteAction()
612
    {
613
        return $this->productWebsiteAction;
614
    }
615
616
    /**
617
     * Set's the action with the category product relation CRUD methods.
618
     *
619
     * @param \TechDivision\Import\Product\Actions\ProductCategoryAction $categoryProductAction The action with the category product relation CRUD methods
620
     *
621
     * @return void
622
     */
623
    public function setCategoryProductAction($categoryProductAction)
624
    {
625
        $this->categoryProductAction = $categoryProductAction;
0 ignored issues
show
Documentation Bug introduced by
It seems like $categoryProductAction of type object<TechDivision\Impo...\ProductCategoryAction> is incompatible with the declared type object<TechDivision\Impo...\CategoryProductAction> of property $categoryProductAction.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
626
    }
627
628
    /**
629
     * Return's the action with the category product relation CRUD methods.
630
     *
631
     * @return \TechDivision\Import\Product\Actions\CategoryProductAction The action instance
632
     */
633
    public function getCategoryProductAction()
634
    {
635
        return $this->categoryProductAction;
636
    }
637
638
    /**
639
     * Set's the action with the stock item CRUD methods.
640
     *
641
     * @param \TechDivision\Import\Product\Actions\StockItemAction $stockItemAction The action with the stock item CRUD methods
642
     *
643
     * @return void
644
     */
645
    public function setStockItemAction($stockItemAction)
646
    {
647
        $this->stockItemAction = $stockItemAction;
648
    }
649
650
    /**
651
     * Return's the action with the stock item CRUD methods.
652
     *
653
     * @return \TechDivision\Import\Product\Actions\StockItemAction The action instance
654
     */
655
    public function getStockItemAction()
656
    {
657
        return $this->stockItemAction;
658
    }
659
660
    /**
661
     * Set's the action with the stock status CRUD methods.
662
     *
663
     * @param \TechDivision\Import\Product\Actions\StockStatusAction $stockStatusAction The action with the stock status CRUD methods
664
     *
665
     * @return void
666
     */
667
    public function setStockStatusAction($stockStatusAction)
668
    {
669
        $this->stockStatusAction = $stockStatusAction;
670
    }
671
672
    /**
673
     * Return's the action with the stock status CRUD methods.
674
     *
675
     * @return \TechDivision\Import\Product\Actions\StockStatusAction The action instance
676
     */
677
    public function getStockStatusAction()
678
    {
679
        return $this->stockStatusAction;
680
    }
681
682
    /**
683
     * Set's the action with the URL rewrite CRUD methods.
684
     *
685
     * @param \TechDivision\Import\Actions\UrlRewriteAction $urlRewriteAction The action with the URL rewrite CRUD methods
686
     *
687
     * @return void
688
     */
689
    public function setUrlRewriteAction($urlRewriteAction)
690
    {
691
        $this->urlRewriteAction = $urlRewriteAction;
692
    }
693
694
    /**
695
     * Return's the action with the URL rewrite CRUD methods.
696
     *
697
     * @return \TechDivision\Import\Actions\UrlRewriteAction The action instance
698
     */
699
    public function getUrlRewriteAction()
700
    {
701
        return $this->urlRewriteAction;
702
    }
703
704
    /**
705
     * Set's the action with the URL rewrite product category CRUD methods.
706
     *
707
     * @param \TechDivision\Import\Product\Actions\UrlRewriteAction $urlRewriteProductCategoryAction The action with the URL rewrite CRUD methods
708
     *
709
     * @return void
710
     */
711
    public function setUrlRewriteProductCategoryAction($urlRewriteProductCategoryAction)
712
    {
713
        $this->urlRewriteProductCategoryAction = $urlRewriteProductCategoryAction;
0 ignored issues
show
Documentation Bug introduced by
It seems like $urlRewriteProductCategoryAction of type object<TechDivision\Impo...tions\UrlRewriteAction> is incompatible with the declared type object<TechDivision\Impo...eProductCategoryAction> of property $urlRewriteProductCategoryAction.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
714
    }
715
716
    /**
717
     * Return's the action with the URL rewrite product category CRUD methods.
718
     *
719
     * @return \TechDivision\Import\Product\Actions\UrlRewriteProductCategoryAction The action instance
720
     */
721
    public function getUrlRewriteProductCategoryAction()
722
    {
723
        return $this->urlRewriteProductCategoryAction;
724
    }
725
726
    /**
727
     * Set's the repository to load the products with.
728
     *
729
     * @param \TechDivision\Import\Product\Repositories\ProductRepository $productRepository The repository instance
730
     *
731
     * @return void
732
     */
733
    public function setProductRepository($productRepository)
734
    {
735
        $this->productRepository = $productRepository;
736
    }
737
738
    /**
739
     * Return's the repository to load the products with.
740
     *
741
     * @return \TechDivision\Import\Product\Repositories\ProductRepository The repository instance
742
     */
743
    public function getProductRepository()
744
    {
745
        return $this->productRepository;
746
    }
747
748
    /**
749
     * Set's the repository to load the product website relations with.
750
     *
751
     * @param \TechDivision\Import\Product\Repositories\ProductWebsiteRepository $productWebsiteRepository The repository instance
752
     *
753
     * @return void
754
     */
755
    public function setProductWebsiteRepository($productWebsiteRepository)
756
    {
757
        $this->productWebsiteRepository = $productWebsiteRepository;
758
    }
759
760
    /**
761
     * Return's the repository to load the product website relations with.
762
     *
763
     * @return \TechDivision\Import\Product\Repositories\ProductWebsiteRepository The repository instance
764
     */
765
    public function getProductWebsiteRepository()
766
    {
767
        return $this->productWebsiteRepository;
768
    }
769
770
    /**
771
     * Set's the repository to load the product datetime attribute with.
772
     *
773
     * @param \TechDivision\Import\Product\Repositories\ProductDatetimeRepository $productDatetimeRepository The repository instance
774
     *
775
     * @return void
776
     */
777
    public function setProductDatetimeRepository($productDatetimeRepository)
778
    {
779
        $this->productDatetimeRepository = $productDatetimeRepository;
780
    }
781
782
    /**
783
     * Return's the repository to load the product datetime attribute with.
784
     *
785
     * @return \TechDivision\Import\Product\Repositories\ProductDatetimeRepository The repository instance
786
     */
787
    public function getProductDatetimeRepository()
788
    {
789
        return $this->productDatetimeRepository;
790
    }
791
792
    /**
793
     * Set's the repository to load the product decimal attribute with.
794
     *
795
     * @param \TechDivision\Import\Product\Repositories\ProductDecimalRepository $productDecimalRepository The repository instance
796
     *
797
     * @return void
798
     */
799
    public function setProductDecimalRepository($productDecimalRepository)
800
    {
801
        $this->productDecimalRepository = $productDecimalRepository;
802
    }
803
804
    /**
805
     * Return's the repository to load the product decimal attribute with.
806
     *
807
     * @return \TechDivision\Import\Product\Repositories\ProductDecimalRepository The repository instance
808
     */
809
    public function getProductDecimalRepository()
810
    {
811
        return $this->productDecimalRepository;
812
    }
813
814
    /**
815
     * Set's the repository to load the product integer attribute with.
816
     *
817
     * @param \TechDivision\Import\Product\Repositories\ProductIntRepository $productIntRepository The repository instance
818
     *
819
     * @return void
820
     */
821
    public function setProductIntRepository($productIntRepository)
822
    {
823
        $this->productIntRepository = $productIntRepository;
824
    }
825
826
    /**
827
     * Return's the repository to load the product integer attribute with.
828
     *
829
     * @return \TechDivision\Import\Product\Repositories\ProductIntRepository The repository instance
830
     */
831
    public function getProductIntRepository()
832
    {
833
        return $this->productIntRepository;
834
    }
835
836
    /**
837
     * Set's the repository to load the product text attribute with.
838
     *
839
     * @param \TechDivision\Import\Product\Repositories\ProductTextRepository $productTextRepository The repository instance
840
     *
841
     * @return void
842
     */
843
    public function setProductTextRepository($productTextRepository)
844
    {
845
        $this->productTextRepository = $productTextRepository;
846
    }
847
848
    /**
849
     * Return's the repository to load the product text attribute with.
850
     *
851
     * @return \TechDivision\Import\Product\Repositories\ProductTextRepository The repository instance
852
     */
853
    public function getProductTextRepository()
854
    {
855
        return $this->productTextRepository;
856
    }
857
858
    /**
859
     * Set's the repository to load the product varchar attribute with.
860
     *
861
     * @param \TechDivision\Import\Product\Repositories\ProductVarcharRepository $productVarcharRepository The repository instance
862
     *
863
     * @return void
864
     */
865
    public function setProductVarcharRepository($productVarcharRepository)
866
    {
867
        $this->productVarcharRepository = $productVarcharRepository;
868
    }
869
870
    /**
871
     * Return's the repository to load the product varchar attribute with.
872
     *
873
     * @return \TechDivision\Import\Product\Repositories\ProductVarcharRepository The repository instance
874
     */
875
    public function getProductVarcharRepository()
876
    {
877
        return $this->productVarcharRepository;
878
    }
879
880
    /**
881
     * Set's the repository to load the category product relations with.
882
     *
883
     * @param \TechDivision\Import\Product\Repositories\CategoryProductRepository $categoryProductRepository The repository instance
884
     *
885
     * @return void
886
     */
887
    public function setCategoryProductRepository($categoryProductRepository)
888
    {
889
        $this->categoryProductRepository = $categoryProductRepository;
890
    }
891
892
    /**
893
     * Return's the repository to load the category product relations with.
894
     *
895
     * @return \TechDivision\Import\Product\Repositories\CategoryProductRepository The repository instance
896
     */
897
    public function getCategoryProductRepository()
898
    {
899
        return $this->categoryProductRepository;
900
    }
901
902
    /**
903
     * Set's the repository to load the stock status with.
904
     *
905
     * @param \TechDivision\Import\Product\Repositories\StockStatusRepository $stockStatusRepository The repository instance
906
     *
907
     * @return void
908
     */
909
    public function setStockStatusRepository($stockStatusRepository)
910
    {
911
        $this->stockStatusRepository = $stockStatusRepository;
912
    }
913
914
    /**
915
     * Return's the repository to load the stock status with.
916
     *
917
     * @return \TechDivision\Import\Product\Repositories\StockStatusRepository The repository instance
918
     */
919
    public function getStockStatusRepository()
920
    {
921
        return $this->stockStatusRepository;
922
    }
923
924
    /**
925
     * Set's the repository to load the stock items with.
926
     *
927
     * @param \TechDivision\Import\Product\Repositories\StockItemRepository $stockItemRepository The repository instance
928
     *
929
     * @return void
930
     */
931
    public function setStockItemRepository($stockItemRepository)
932
    {
933
        $this->stockItemRepository = $stockItemRepository;
934
    }
935
936
    /**
937
     * Return's the repository to load the stock items with.
938
     *
939
     * @return \TechDivision\Import\Product\Repositories\StockItemRepository The repository instance
940
     */
941
    public function getStockItemRepository()
942
    {
943
        return $this->stockItemRepository;
944
    }
945
946
    /**
947
     * Set's the repository to load the URL rewrites with.
948
     *
949
     * @param \TechDivision\Import\Repositories\UrlRewriteRepository $urlRewriteRepository The repository instance
950
     *
951
     * @return void
952
     */
953
    public function setUrlRewriteRepository($urlRewriteRepository)
954
    {
955
        $this->urlRewriteRepository = $urlRewriteRepository;
956
    }
957
958
    /**
959
     * Return's the repository to load the URL rewrites with.
960
     *
961
     * @return \TechDivision\Import\Repositories\UrlRewriteRepository The repository instance
962
     */
963
    public function getUrlRewriteRepository()
964
    {
965
        return $this->urlRewriteRepository;
0 ignored issues
show
Bug Best Practice introduced by
The return type of return $this->urlRewriteRepository; (TechDivision\Import\Repo...es\UrlRewriteRepository) is incompatible with the return type declared by the interface TechDivision\Import\Prod...getUrlRewriteRepository of type TechDivision\Import\Prod...es\UrlRewriteRepository.

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

Let’s take a look at an example:

class Author {
    private $name;

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

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

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

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

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

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

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

Loading history...
966
    }
967
968
    /**
969
     * Set's the repository to load the URL rewrite product category relations with.
970
     *
971
     * @param \TechDivision\Import\Product\Repositories\UrlRewriteProductCategoryRepository $urlRewriteProductCategoryRepository The repository instance
972
     *
973
     * @return void
974
     */
975
    public function setUrlRewriteProductCategoryRepository($urlRewriteProductCategoryRepository)
976
    {
977
        $this->urlRewriteProductCategoryRepository = $urlRewriteProductCategoryRepository;
978
    }
979
980
    /**
981
     * Return's the repository to load the URL rewrite product category relations with.
982
     *
983
     * @return \TechDivision\Import\Product\Repositories\UrlRewriteProductCategoryRepository The repository instance
984
     */
985
    public function getUrlRewriteProductCategoryRepository()
986
    {
987
        return $this->urlRewriteProductCategoryRepository;
988
    }
989
990
    /**
991
     * Load's and return's the EAV attribute option value with the passed code, store ID and value.
992
     *
993
     * @param string  $attributeCode The code of the EAV attribute option to load
994
     * @param integer $storeId       The store ID of the attribute option to load
995
     * @param string  $value         The value of the attribute option to load
996
     *
997
     * @return array The EAV attribute option value
998
     */
999
    public function loadEavAttributeOptionValueByAttributeCodeAndStoreIdAndValue($attributeCode, $storeId, $value)
1000
    {
1001
        return $this->getEavAttributeOptionValueRepository()->findOneByAttributeCodeAndStoreIdAndValue($attributeCode, $storeId, $value);
1002
    }
1003
1004
    /**
1005
     * Return's the URL rewrites for the passed URL entity type and ID.
1006
     *
1007
     * @param string  $entityType The entity type to load the URL rewrites for
1008
     * @param integer $entityId   The entity ID to laod the rewrites for
1009
     *
1010
     * @return array The URL rewrites
1011
     */
1012
    public function getUrlRewritesByEntityTypeAndEntityId($entityType, $entityId)
1013
    {
1014
        return $this->getUrlRewriteRepository()->findAllByEntityTypeAndEntityId($entityType, $entityId);
1015
    }
1016
1017
    /**
1018
     * Load's and return's the product with the passed SKU.
1019
     *
1020
     * @param string $sku The SKU of the product to load
1021
     *
1022
     * @return array The product
1023
     */
1024
    public function loadProduct($sku)
1025
    {
1026
        return $this->getProductRepository()->findOneBySku($sku);
1027
    }
1028
1029
    /**
1030
     * Load's and return's the product website relation with the passed product and website ID.
1031
     *
1032
     * @param string $productId The product ID of the relation
1033
     * @param string $websiteId The website ID of the relation
1034
     *
1035
     * @return array The product website
1036
     */
1037
    public function loadProductWebsite($productId, $websiteId)
1038
    {
1039
        return $this->getProductWebsiteRepository()->findOneByProductIdAndWebsite($productId, $websiteId);
1040
    }
1041
1042
    /**
1043
     * Return's the category product relation with the passed category/product ID.
1044
     *
1045
     * @param integer $categoryId The category ID of the category product relation to return
1046
     * @param integer $productId  The product ID of the category product relation to return
1047
     *
1048
     * @return array The category product relation
1049
     */
1050
    public function loadCategoryProduct($categoryId, $productId)
1051
    {
1052
        return $this->getCategoryProductRepository()->findOneByCategoryIdAndProductId($categoryId, $productId);
1053
    }
1054
1055
    /**
1056
     * Load's and return's the stock status with the passed product/website/stock ID.
1057
     *
1058
     * @param integer $productId The product ID of the stock status to load
1059
     * @param integer $websiteId The website ID of the stock status to load
1060
     * @param integer $stockId   The stock ID of the stock status to load
1061
     *
1062
     * @return array The stock status
1063
     */
1064
    public function loadStockStatus($productId, $websiteId, $stockId)
1065
    {
1066
        return $this->getStockStatusRepository()->findOneByProductIdAndWebsiteIdAndStockId($productId, $websiteId, $stockId);
1067
    }
1068
1069
    /**
1070
     * Load's and return's the stock status with the passed product/website/stock ID.
1071
     *
1072
     * @param integer $productId The product ID of the stock item to load
1073
     * @param integer $websiteId The website ID of the stock item to load
1074
     * @param integer $stockId   The stock ID of the stock item to load
1075
     *
1076
     * @return array The stock item
1077
     */
1078
    public function loadStockItem($productId, $websiteId, $stockId)
1079
    {
1080
        return $this->getStockItemRepository()->findOneByProductIdAndWebsiteIdAndStockId($productId, $websiteId, $stockId);
1081
    }
1082
1083
    /**
1084
     * Load's and return's the datetime attribute with the passed entity/attribute/store ID.
1085
     *
1086
     * @param integer $entityId    The entity ID of the attribute
1087
     * @param integer $attributeId The attribute ID of the attribute
1088
     * @param integer $storeId     The store ID of the attribute
1089
     *
1090
     * @return array|null The datetime attribute
1091
     */
1092
    public function loadProductDatetimeAttribute($entityId, $attributeId, $storeId)
1093
    {
1094
        return  $this->getProductDatetimeRepository()->findOneByEntityIdAndAttributeIdAndStoreId($entityId, $attributeId, $storeId);
1095
    }
1096
1097
    /**
1098
     * Load's and return's the decimal attribute with the passed entity/attribute/store ID.
1099
     *
1100
     * @param integer $entityId    The entity ID of the attribute
1101
     * @param integer $attributeId The attribute ID of the attribute
1102
     * @param integer $storeId     The store ID of the attribute
1103
     *
1104
     * @return array|null The decimal attribute
1105
     */
1106
    public function loadProductDecimalAttribute($entityId, $attributeId, $storeId)
1107
    {
1108
        return  $this->getProductDecimalRepository()->findOneByEntityIdAndAttributeIdAndStoreId($entityId, $attributeId, $storeId);
1109
    }
1110
1111
    /**
1112
     * Load's and return's the integer attribute with the passed entity/attribute/store ID.
1113
     *
1114
     * @param integer $entityId    The entity ID of the attribute
1115
     * @param integer $attributeId The attribute ID of the attribute
1116
     * @param integer $storeId     The store ID of the attribute
1117
     *
1118
     * @return array|null The integer attribute
1119
     */
1120
    public function loadProductIntAttribute($entityId, $attributeId, $storeId)
1121
    {
1122
        return $this->getProductIntRepository()->findOneByEntityIdAndAttributeIdAndStoreId($entityId, $attributeId, $storeId);
1123
    }
1124
1125
    /**
1126
     * Load's and return's the text attribute with the passed entity/attribute/store ID.
1127
     *
1128
     * @param integer $entityId    The entity ID of the attribute
1129
     * @param integer $attributeId The attribute ID of the attribute
1130
     * @param integer $storeId     The store ID of the attribute
1131
     *
1132
     * @return array|null The text attribute
1133
     */
1134
    public function loadProductTextAttribute($entityId, $attributeId, $storeId)
1135
    {
1136
        return $this->getProductTextRepository()->findOneByEntityIdAndAttributeIdAndStoreId($entityId, $attributeId, $storeId);
1137
    }
1138
1139
    /**
1140
     * Load's and return's the varchar attribute with the passed entity/attribute/store ID.
1141
     *
1142
     * @param integer $entityId    The entity ID of the attribute
1143
     * @param integer $attributeId The attribute ID of the attribute
1144
     * @param integer $storeId     The store ID of the attribute
1145
     *
1146
     * @return array|null The varchar attribute
1147
     */
1148
    public function loadProductVarcharAttribute($entityId, $attributeId, $storeId)
1149
    {
1150
        return $this->getProductVarcharRepository()->findOneByEntityIdAndAttributeIdAndStoreId($entityId, $attributeId, $storeId);
1151
    }
1152
1153
    /**
1154
     * Load's and return's the varchar attribute with the passed params.
1155
     *
1156
     * @param integer $attributeCode The attribute code of the varchar attribute
1157
     * @param integer $entityTypeId  The entity type ID of the varchar attribute
1158
     * @param integer $storeId       The store ID of the varchar attribute
1159
     * @param string  $value         The value of the varchar attribute
1160
     *
1161
     * @return array|null The varchar attribute
1162
     */
1163
    public function loadProductVarcharAttributeByAttributeCodeAndEntityTypeIdAndStoreIdAndValue($attributeCode, $entityTypeId, $storeId, $value)
1164
    {
1165
        return $this->getProductVarcharRepository()->findOneByAttributeCodeAndEntityTypeIdAndStoreIdAndValue($attributeCode, $entityTypeId, $storeId, $value);
1166
    }
1167
1168
    /**
1169
     * Return's the URL rewrite product category relation for the passed
1170
     * product and category ID.
1171
     *
1172
     * @param integer $productId  The product ID to load the URL rewrite product category relation for
1173
     * @param integer $categoryId The category ID to load the URL rewrite product category relation for
1174
     *
1175
     * @return array|false The URL rewrite product category relations
1176
     */
1177
    public function loadUrlRewriteProductCategory($productId, $categoryId)
1178
    {
1179
        return $this->getUrlRewriteProductCategoryRepository()->findOneByProductIdAndCategoryId($productId, $categoryId);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The expression $this->getUrlRewriteProd...roductId, $categoryId); of type array|false adds false to the return on line 1179 which is incompatible with the return type declared by the interface TechDivision\Import\Prod...lRewriteProductCategory of type array|null. It seems like you forgot to handle an error condition.
Loading history...
1180
    }
1181
1182
    /**
1183
     * Persist's the passed product data and return's the ID.
1184
     *
1185
     * @param array       $product The product data to persist
1186
     * @param string|null $name    The name of the prepared statement that has to be executed
1187
     *
1188
     * @return string The ID of the persisted entity
1189
     */
1190
    public function persistProduct($product, $name = null)
1191
    {
1192
        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...
1193
    }
1194
1195
    /**
1196
     * Persist's the passed product varchar attribute.
1197
     *
1198
     * @param array       $attribute The attribute to persist
1199
     * @param string|null $name      The name of the prepared statement that has to be executed
1200
     *
1201
     * @return void
1202
     */
1203
    public function persistProductVarcharAttribute($attribute, $name = null)
1204
    {
1205
        $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...
1206
    }
1207
1208
    /**
1209
     * Persist's the passed product integer attribute.
1210
     *
1211
     * @param array       $attribute The attribute to persist
1212
     * @param string|null $name      The name of the prepared statement that has to be executed
1213
     *
1214
     * @return void
1215
     */
1216
    public function persistProductIntAttribute($attribute, $name = null)
1217
    {
1218
        $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...
1219
    }
1220
1221
    /**
1222
     * Persist's the passed product decimal attribute.
1223
     *
1224
     * @param array       $attribute The attribute to persist
1225
     * @param string|null $name      The name of the prepared statement that has to be executed
1226
     *
1227
     * @return void
1228
     */
1229
    public function persistProductDecimalAttribute($attribute, $name = null)
1230
    {
1231
        $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...
1232
    }
1233
1234
    /**
1235
     * Persist's the passed product datetime attribute.
1236
     *
1237
     * @param array       $attribute The attribute to persist
1238
     * @param string|null $name      The name of the prepared statement that has to be executed
1239
     *
1240
     * @return void
1241
     */
1242
    public function persistProductDatetimeAttribute($attribute, $name = null)
1243
    {
1244
        $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...
1245
    }
1246
1247
    /**
1248
     * Persist's the passed product text attribute.
1249
     *
1250
     * @param array       $attribute The attribute to persist
1251
     * @param string|null $name      The name of the prepared statement that has to be executed
1252
     *
1253
     * @return void
1254
     */
1255
    public function persistProductTextAttribute($attribute, $name = null)
1256
    {
1257
        $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...
1258
    }
1259
1260
    /**
1261
     * Persist's the passed product website data and return's the ID.
1262
     *
1263
     * @param array       $productWebsite The product website data to persist
1264
     * @param string|null $name           The name of the prepared statement that has to be executed
1265
     *
1266
     * @return void
1267
     */
1268
    public function persistProductWebsite($productWebsite, $name = null)
1269
    {
1270
        $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...
1271
    }
1272
1273
    /**
1274
     * Persist's the passed category product relation.
1275
     *
1276
     * @param array       $categoryProduct The category product relation to persist
1277
     * @param string|null $name            The name of the prepared statement that has to be executed
1278
     *
1279
     * @return void
1280
     */
1281
    public function persistCategoryProduct($categoryProduct, $name = null)
1282
    {
1283
        $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...
1284
    }
1285
1286
    /**
1287
     * Persist's the passed stock item data and return's the ID.
1288
     *
1289
     * @param array       $stockItem The stock item data to persist
1290
     * @param string|null $name      The name of the prepared statement that has to be executed
1291
     *
1292
     * @return void
1293
     */
1294
    public function persistStockItem($stockItem, $name = null)
1295
    {
1296
        $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...
1297
    }
1298
1299
    /**
1300
     * Persist's the passed stock status data and return's the ID.
1301
     *
1302
     * @param array       $stockStatus The stock status data to persist
1303
     * @param string|null $name        The name of the prepared statement that has to be executed
1304
     *
1305
     * @return void
1306
     */
1307
    public function persistStockStatus($stockStatus, $name = null)
1308
    {
1309
        $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...
1310
    }
1311
1312
    /**
1313
     * Persist's the URL write with the passed data.
1314
     *
1315
     * @param array       $row  The URL rewrite to persist
1316
     * @param string|null $name The name of the prepared statement that has to be executed
1317
     *
1318
     * @return string The ID of the persisted entity
1319
     */
1320
    public function persistUrlRewrite($row, $name = null)
1321
    {
1322
        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...
1323
    }
1324
1325
    /**
1326
     * Persist's the URL rewrite product => category relation with the passed data.
1327
     *
1328
     * @param array       $row  The URL rewrite product => category relation to persist
1329
     * @param string|null $name The name of the prepared statement that has to be executed
1330
     *
1331
     * @return void
1332
     */
1333
    public function persistUrlRewriteProductCategory($row, $name = null)
1334
    {
1335
        $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...
1336
    }
1337
1338
    /**
1339
     * Delete's the entity with the passed attributes.
1340
     *
1341
     * @param array       $row  The attributes of the entity to delete
1342
     * @param string|null $name The name of the prepared statement that has to be executed
1343
     *
1344
     * @return void
1345
     */
1346
    public function deleteProduct($row, $name = null)
1347
    {
1348
        $this->getProductAction()->delete($row, $name);
1349
    }
1350
1351
    /**
1352
     * Delete's the URL rewrite with the passed attributes.
1353
     *
1354
     * @param array       $row  The attributes of the entity to delete
1355
     * @param string|null $name The name of the prepared statement that has to be executed
1356
     *
1357
     * @return void
1358
     */
1359
    public function deleteUrlRewrite($row, $name = null)
1360
    {
1361
        $this->getUrlRewriteAction()->delete($row, $name);
1362
    }
1363
1364
    /**
1365
     * Delete's the stock item(s) with the passed attributes.
1366
     *
1367
     * @param array       $row  The attributes of the entity to delete
1368
     * @param string|null $name The name of the prepared statement that has to be executed
1369
     *
1370
     * @return void
1371
     */
1372
    public function deleteStockItem($row, $name = null)
1373
    {
1374
        $this->getStockItemAction()->delete($row, $name);
1375
    }
1376
1377
    /**
1378
     * Delete's the stock status with the passed attributes.
1379
     *
1380
     * @param array       $row  The attributes of the entity to delete
1381
     * @param string|null $name The name of the prepared statement that has to be executed
1382
     *
1383
     * @return void
1384
     */
1385
    public function deleteStockStatus($row, $name = null)
1386
    {
1387
        $this->getStockStatusAction()->delete($row, $name);
1388
    }
1389
1390
    /**
1391
     * Delete's the product website relations with the passed attributes.
1392
     *
1393
     * @param array       $row  The attributes of the entity to delete
1394
     * @param string|null $name The name of the prepared statement that has to be executed
1395
     *
1396
     * @return void
1397
     */
1398
    public function deleteProductWebsite($row, $name = null)
1399
    {
1400
        $this->getProductWebsiteAction()->delete($row, $name);
1401
    }
1402
1403
    /**
1404
     * Delete's the category product relations with the passed attributes.
1405
     *
1406
     * @param array       $row  The attributes of the entity to delete
1407
     * @param string|null $name The name of the prepared statement that has to be executed
1408
     *
1409
     * @return void
1410
     */
1411
    public function deleteCategoryProduct($row, $name = null)
1412
    {
1413
        $this->getCategoryProductAction()->delete($row, $name);
1414
    }
1415
}
1416