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

BunchSubject::loadStockItem()   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 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 3
crap 2
1
<?php
2
3
/**
4
 * TechDivision\Import\Product\Subjects\BunchSubject
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\Subjects;
22
23
use TechDivision\Import\Subjects\ExportableTrait;
24
use TechDivision\Import\Subjects\ExportableSubjectInterface;
25
use TechDivision\Import\Product\Utils\MemberNames;
26
use TechDivision\Import\Product\Utils\RegistryKeys;
27
use TechDivision\Import\Product\Utils\VisibilityKeys;
28
use TechDivision\Import\Utils\StoreViewCodes;
29
30
/**
31
 * The subject implementation that handles the business logic to persist products.
32
 *
33
 * @author    Tim Wagner <[email protected]>
34
 * @copyright 2016 TechDivision GmbH <[email protected]>
35
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
36
 * @link      https://github.com/techdivision/import-product
37
 * @link      http://www.techdivision.com
38
 */
39
class BunchSubject extends AbstractProductSubject implements ExportableSubjectInterface
0 ignored issues
show
Bug introduced by
There is one abstract method getEavAttributeOptionValueByOptionValueAndStoreId in this class; you could implement it, or declare this class as abstract.
Loading history...
40
{
41
42
    /**
43
     * The trait that implements the export functionality.
44
     *
45
     * @var \TechDivision\Import\Subjects\ExportableTrait
46
     */
47
    use ExportableTrait;
48
49
    /**
50
     * The array with the pre-loaded entity IDs.
51
     *
52
     * @var array
53
     */
54
    protected $preLoadedEntityIds = array();
55
56
    /**
57
     * Mappings for the table column => CSV column header.
58
     *
59
     * @var array
60
     */
61
    protected $headerStockMappings = array(
62
        'qty'                         => array('qty', 'float'),
63
        'min_qty'                     => array('out_of_stock_qty', 'float'),
64
        'use_config_min_qty'          => array('use_config_min_qty', 'int'),
65
        'is_qty_decimal'              => array('is_qty_decimal', 'int'),
66
        'backorders'                  => array('allow_backorders', 'int'),
67
        'use_config_backorders'       => array('use_config_backorders', 'int'),
68
        'min_sale_qty'                => array('min_cart_qty', 'float'),
69
        'use_config_min_sale_qty'     => array('use_config_min_sale_qty', 'int'),
70
        'max_sale_qty'                => array('max_cart_qty', 'float'),
71
        'use_config_max_sale_qty'     => array('use_config_max_sale_qty', 'int'),
72
        'is_in_stock'                 => array('is_in_stock', 'int'),
73
        'notify_stock_qty'            => array('notify_on_stock_below', 'float'),
74
        'use_config_notify_stock_qty' => array('use_config_notify_stock_qty', 'int'),
75
        'manage_stock'                => array('manage_stock', 'int'),
76
        'use_config_manage_stock'     => array('use_config_manage_stock', 'int'),
77
        'use_config_qty_increments'   => array('use_config_qty_increments', 'int'),
78
        'qty_increments'              => array('qty_increments', 'float'),
79
        'use_config_enable_qty_inc'   => array('use_config_enable_qty_inc', 'int'),
80
        'enable_qty_increments'       => array('enable_qty_increments', 'int'),
81
        'is_decimal_divided'          => array('is_decimal_divided', 'int'),
82
    );
83
84
    /**
85
     * The array with the available visibility keys.
86
     *
87
     * @var array
88
     */
89
    protected $availableVisibilities = array(
90
        'Not Visible Individually' => VisibilityKeys::VISIBILITY_NOT_VISIBLE,
91
        'Catalog'                  => VisibilityKeys::VISIBILITY_IN_CATALOG,
92
        'Search'                   => VisibilityKeys::VISIBILITY_IN_SEARCH,
93
        'Catalog, Search'          => VisibilityKeys::VISIBILITY_BOTH
94
    );
95
96
    /**
97
     * The category IDs the product is related with.
98
     *
99
     * @var array
100
     */
101
    protected $productCategoryIds = array();
102
103
    /**
104
     * The default callback mappings for the Magento standard product attributes.
105
     *
106
     * @var array
107
     */
108
    protected $defaultCallbackMappings = array(
109
        'visibility'           => array('import_product.callback.visibility'),
110
        'tax_class_id'         => array('import_product.callback.tax.class'),
111
        'bundle_price_type'    => array('import_product_bundle.callback.bundle.type'),
112
        'bundle_sku_type'      => array('import_product_bundle.callback.bundle.type'),
113
        'bundle_weight_type'   => array('import_product_bundle.callback.bundle.type'),
114
        'bundle_price_view'    => array('import_product_bundle.callback.bundle.price.view'),
115
        'bundle_shipment_type' => array('import_product_bundle.callback.bundle.shipment.type')
116
    );
117
118
    /**
119
     * The used URL keys.
120
     *
121
     * @var array
122
     */
123
    protected $usedUrlKeys = array();
124
125
    /**
126
     * The available entity types.
127
     *
128
     * @var array
129
     */
130
    protected $entityTypes = array();
131
132
    /**
133
     * Intializes the previously loaded global data for exactly one bunch.
134
     *
135
     * @param string $serial The serial of the actual import
136
     *
137
     * @return void
138
     * @see \Importer\Csv\Actions\ProductImportAction::prepare()
139
     */
140
    public function setUp($serial)
141
    {
142
143
        // load the status of the actual import
144
        $status = $this->getRegistryProcessor()->getAttribute($serial);
145
146
        // load the global data we've prepared initially
147
        $this->entityTypes = $status[RegistryKeys::GLOBAL_DATA][RegistryKeys::ENTITY_TYPES];
148
149
        // invoke the parent method
150
        parent::setUp($serial);
151
    }
152
153
    /**
154
     * Clean up the global data after importing the bunch.
155
     *
156
     * @param string $serial The serial of the actual import
157
     *
158
     * @return void
159
     */
160
    public function tearDown($serial)
161
    {
162
163
        // invoke the parent method
164
        parent::tearDown($serial);
165
166
        // load the registry processor
167
        $registryProcessor = $this->getRegistryProcessor();
168
169
        // update the status
170
        $registryProcessor->mergeAttributesRecursive(
171
            $serial,
172
            array(
173
                RegistryKeys::PRE_LOADED_ENTITY_IDS => $this->preLoadedEntityIds,
174
            )
175
        );
176
    }
177
178
    /**
179
     * Return's the default callback mappings.
180
     *
181
     * @return array The default callback mappings
182
     */
183
    public function getDefaultCallbackMappings()
184
    {
185
        return $this->defaultCallbackMappings;
186
    }
187
188
    /**
189
     * Return's the mappings for the table column => CSV column header.
190
     *
191
     * @return array The header stock mappings
192
     */
193 1
    public function getHeaderStockMappings()
194
    {
195 1
        return $this->headerStockMappings;
196
    }
197
198
    /**
199
     * Return's the visibility key for the passed visibility string.
200
     *
201
     * @param string $visibility The visibility string to return the key for
202
     *
203
     * @return integer The requested visibility key
204
     * @throws \Exception Is thrown, if the requested visibility is not available
205
     */
206
    public function getVisibilityIdByValue($visibility)
207
    {
208
209
        // query whether or not, the requested visibility is available
210
        if (isset($this->availableVisibilities[$visibility])) {
211
            return $this->availableVisibilities[$visibility];
212
        }
213
214
        // throw an exception, if not
215
        throw new \Exception(
216
            $this->appendExceptionSuffix(
217
                sprintf('Found invalid visibility %s', $visibility)
218
            )
219
        );
220
    }
221
222
    /**
223
     * Add the passed category ID to the product's category list.
224
     *
225
     * @param integer $categoryId The category ID to add
226
     *
227
     * @return void
228
     */
229
    public function addProductCategoryId($categoryId)
230
    {
231
        $this->productCategoryIds[$this->getLastEntityId()][$categoryId] = $this->getLastEntityId();
232
    }
233
234
    /**
235
     * Return's the list with category IDs the product is related with.
236
     *
237
     * @return array The product's category IDs
238
     */
239
    public function getProductCategoryIds()
240
    {
241
242
        // initialize the array with the product's category IDs
243
        $categoryIds = array();
244
245
        // query whether or not category IDs are available for the actual product entity
246
        if (isset($this->productCategoryIds[$lastEntityId = $this->getLastEntityId()])) {
247
            $categoryIds = $this->productCategoryIds[$lastEntityId];
248
        }
249
250
        // return the array with the product's category IDs
251
        return $categoryIds;
252
    }
253
254
    /**
255
     * Pre-load the entity ID for the product with the passed SKU
256
     * and persist it temporary in the registry.
257
     *
258
     * @param string $sku The SKU of the product to be pre-loaded
259
     *
260
     * @return void
261
     */
262
    public function preLoadEntityId($sku)
263
    {
264
265
        // load the product by the passed SKU
266
        $product = $this->loadProduct($sku);
267
268
        // temporary persist the pre-loaded SKU => entity ID mapping
269
        $this->preLoadedEntityIds[$sku]= $product[MemberNames::ENTITY_ID];
270
    }
271
272
    /**
273
     * Make's the passed URL key unique by adding the next number to the end.
274
     *
275
     * @param string $urlKey The URL key to make unique
276
     *
277
     * @return string The unique URL key
278
     */
279
    public function makeUrlKeyUnique($urlKey)
280
    {
281
282
        // initialize the entity type ID
283
        $entityType = $this->getEntityType();
284
        $entityTypeId = $entityType[MemberNames::ENTITY_TYPE_ID];
285
286
        // initialize the query parameters
287
        $storeId = $this->getRowStoreId(StoreViewCodes::ADMIN);
288
289
        // initialize the counter
290
        $counter = 0;
291
292
        // initialize the counters
293
        $matchingCounters = array();
294
        $notMatchingCounters = array();
295
296
        // pre-initialze the URL key to query for
297
        $value = $urlKey;
298
299
        do {
300
            // try to load the attribute
301
            $productVarcharAttribute = $this->getProductProcessor()
302
                                            ->loadProductVarcharAttributeByAttributeCodeAndEntityTypeIdAndStoreIdAndValue(
303
                                                MemberNames::URL_KEY,
304
                                                $entityTypeId,
305
                                                $storeId,
306
                                                $value
307
                                            );
308
309
            // try to load the product's URL key
310
            if ($productVarcharAttribute) {
311
                // this IS the URL key of the passed entity
312
                if ($this->isUrlKeyOf($productVarcharAttribute)) {
313
                    $matchingCounters[] = $counter;
314
                } else {
315
                    $notMatchingCounters[] = $counter;
316
                }
317
318
                // prepare the next URL key to query for
319
                $value = sprintf('%s-%d', $urlKey, ++$counter);
320
            }
321
0 ignored issues
show
Coding Style introduced by
Blank line found at end of control structure
Loading history...
322
        } while ($productVarcharAttribute);
323
324
        // sort the array ascending according to the counter
325
        asort($matchingCounters);
326
        asort($notMatchingCounters);
327
328
        // this IS the URL key of the passed entity => we've an UPDATE
329
        if (sizeof($matchingCounters) > 0) {
330
            // load highest counter
331
            $counter = end($matchingCounters);
332
            // if the counter is > 0, we've to append it to the new URL key
333
            if ($counter > 0) {
334
                $urlKey = sprintf('%s-%d', $urlKey, $counter);
335
            }
336
        } elseif (sizeof($notMatchingCounters) > 0) {
337
            // create a new URL key by raising the counter
338
            $newCounter = end($notMatchingCounters);
339
            $urlKey = sprintf('%s-%d', $urlKey, ++$newCounter);
340
        }
341
342
        // return the passed URL key, if NOT
343
        return $urlKey;
344
    }
345
346
    /**
347
     * Return's the entity type for the configured entity type code.
348
     *
349
     * @return array The requested entity type
350
     * @throws \Exception Is thrown, if the requested entity type is not available
351
     */
352 View Code Duplication
    protected function getEntityType()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
353
    {
354
355
        // query whether or not the entity type with the passed code is available
356
        if (isset($this->entityTypes[$entityTypeCode = $this->getEntityTypeCode()])) {
357
            return $this->entityTypes[$entityTypeCode];
358
        }
359
360
        // throw a new exception
361
        throw new \Exception(
362
            $this->appendExceptionSuffix(
363
                sprintf('Requested entity type "%s" is not available', $entityTypeCode)
364
            )
365
        );
366
    }
367
368
    /**
369
     * Return's TRUE, if the passed URL key varchar value IS related with the actual PK.
370
     *
371
     * @param array $productVarcharAttribute The varchar value to check
372
     *
373
     * @return boolean TRUE if the URL key is related, else FALSE
374
     */
375
    protected function isUrlKeyOf(array $productVarcharAttribute)
376
    {
377
        return $productVarcharAttribute[MemberNames::ENTITY_ID] === $this->getLastEntityId();
378
    }
379
380
    /**
381
     * Return's an array with the available EAV attributes for the passed is user defined flag.
382
     *
383
     * @param integer $isUserDefined The flag itself
384
     *
385
     * @return array The array with the EAV attributes matching the passed flag
386
     */
387
    public function getEavAttributeByIsUserDefined($isUserDefined = 1)
388
    {
389
        return $this->getProductProcessor()->getEavAttributeByIsUserDefined($isUserDefined);
390
    }
391
392
    /**
393
     * Return's the URL rewrites for the passed URL entity type and ID.
394
     *
395
     * @param string  $entityType The entity type to load the URL rewrites for
396
     * @param integer $entityId   The entity ID to laod the rewrites for
397
     *
398
     * @return array The URL rewrites
399
     */
400 1
    public function getUrlRewritesByEntityTypeAndEntityId($entityType, $entityId)
401
    {
402 1
        return $this->getProductProcessor()->getUrlRewritesByEntityTypeAndEntityId($entityType, $entityId);
403
    }
404
405
    /**
406
     * Load's and return's the product with the passed SKU.
407
     *
408
     * @param string $sku The SKU of the product to load
409
     *
410
     * @return array The product
411
     */
412
    public function loadProduct($sku)
413
    {
414
        return $this->getProductProcessor()->loadProduct($sku);
415
    }
416
417
    /**
418
     * Load's and return's the product website relation with the passed product and website ID.
419
     *
420
     * @param string $productId The product ID of the relation
421
     * @param string $websiteId The website ID of the relation
422
     *
423
     * @return array The product website
424
     */
425
    public function loadProductWebsite($productId, $websiteId)
426
    {
427
        return $this->getProductProcessor()->loadProductWebsite($productId, $websiteId);
428
    }
429
430
    /**
431
     * Return's the category product relation with the passed category/product ID.
432
     *
433
     * @param integer $categoryId The category ID of the category product relation to return
434
     * @param integer $productId  The product ID of the category product relation to return
435
     *
436
     * @return array The category product relation
437
     */
438
    public function loadCategoryProduct($categoryId, $productId)
439
    {
440
        return $this->getProductProcessor()->loadCategoryProduct($categoryId, $productId);
441
    }
442
443
    /**
444
     * Load's and return's the stock status with the passed product/website/stock ID.
445
     *
446
     * @param integer $productId The product ID of the stock status to load
447
     * @param integer $websiteId The website ID of the stock status to load
448
     * @param integer $stockId   The stock ID of the stock status to load
449
     *
450
     * @return array The stock status
451
     */
452
    public function loadStockStatus($productId, $websiteId, $stockId)
453
    {
454
        return $this->getProductProcessor()->loadStockStatus($productId, $websiteId, $stockId);
455
    }
456
457
    /**
458
     * Load's and return's the stock status with the passed product/website/stock ID.
459
     *
460
     * @param integer $productId The product ID of the stock item to load
461
     * @param integer $websiteId The website ID of the stock item to load
462
     * @param integer $stockId   The stock ID of the stock item to load
463
     *
464
     * @return array The stock item
465
     */
466
    public function loadStockItem($productId, $websiteId, $stockId)
467
    {
468
        return $this->getProductProcessor()->loadStockItem($productId, $websiteId, $stockId);
469
    }
470
471
    /**
472
     * Load's and return's the datetime attribute with the passed entity/attribute/store ID.
473
     *
474
     * @param integer $entityId    The entity ID of the attribute
475
     * @param integer $attributeId The attribute ID of the attribute
476
     * @param integer $storeId     The store ID of the attribute
477
     *
478
     * @return array|null The datetime attribute
479
     */
480
    public function loadProductDatetimeAttribute($entityId, $attributeId, $storeId)
481
    {
482
        return $this->getProductProcessor()->loadProductDatetimeAttribute($entityId, $attributeId, $storeId);
483
    }
484
485
    /**
486
     * Load's and return's the decimal attribute with the passed entity/attribute/store ID.
487
     *
488
     * @param integer $entityId    The entity ID of the attribute
489
     * @param integer $attributeId The attribute ID of the attribute
490
     * @param integer $storeId     The store ID of the attribute
491
     *
492
     * @return array|null The decimal attribute
493
     */
494
    public function loadProductDecimalAttribute($entityId, $attributeId, $storeId)
495
    {
496
        return $this->getProductProcessor()->loadProductDecimalAttribute($entityId, $attributeId, $storeId);
497
    }
498
499
    /**
500
     * Load's and return's the integer attribute with the passed entity/attribute/store ID.
501
     *
502
     * @param integer $entityId    The entity ID of the attribute
503
     * @param integer $attributeId The attribute ID of the attribute
504
     * @param integer $storeId     The store ID of the attribute
505
     *
506
     * @return array|null The integer attribute
507
     */
508
    public function loadProductIntAttribute($entityId, $attributeId, $storeId)
509
    {
510
        return $this->getProductProcessor()->loadProductIntAttribute($entityId, $attributeId, $storeId);
511
    }
512
513
    /**
514
     * Load's and return's the text attribute with the passed entity/attribute/store ID.
515
     *
516
     * @param integer $entityId    The entity ID of the attribute
517
     * @param integer $attributeId The attribute ID of the attribute
518
     * @param integer $storeId     The store ID of the attribute
519
     *
520
     * @return array|null The text attribute
521
     */
522
    public function loadProductTextAttribute($entityId, $attributeId, $storeId)
523
    {
524
        return $this->getProductProcessor()->loadProductTextAttribute($entityId, $attributeId, $storeId);
525
    }
526
527
    /**
528
     * Load's and return's the varchar attribute with the passed entity/attribute/store ID.
529
     *
530
     * @param integer $entityId    The entity ID of the attribute
531
     * @param integer $attributeId The attribute ID of the attribute
532
     * @param integer $storeId     The store ID of the attribute
533
     *
534
     * @return array|null The varchar attribute
535
     */
536
    public function loadProductVarcharAttribute($entityId, $attributeId, $storeId)
537
    {
538
        return $this->getProductProcessor()->loadProductVarcharAttribute($entityId, $attributeId, $storeId);
539
    }
540
541
    /**
542
     * Return's the URL rewrite product category relation for the passed
543
     * product and category ID.
544
     *
545
     * @param integer $productId  The product ID to load the URL rewrite product category relation for
546
     * @param integer $categoryId The category ID to load the URL rewrite product category relation for
547
     *
548
     * @return array|false The URL rewrite product category relations
549
     */
550
    public function loadUrlRewriteProductCategory($productId, $categoryId)
551
    {
552
        return $this->getProductProcessor()->loadUrlRewriteProductCategory($productId, $categoryId);
553
    }
554
555
    /**
556
     * Persist's the passed product data and return's the ID.
557
     *
558
     * @param array $product The product data to persist
559
     *
560
     * @return string The ID of the persisted entity
561
     */
562
    public function persistProduct($product)
563
    {
564
        return $this->getProductProcessor()->persistProduct($product);
565
    }
566
567
    /**
568
     * Persist's the passed product varchar attribute.
569
     *
570
     * @param array $attribute The attribute to persist
571
     *
572
     * @return void
573
     */
574
    public function persistProductVarcharAttribute($attribute)
575
    {
576
        $this->getProductProcessor()->persistProductVarcharAttribute($attribute);
577
    }
578
579
    /**
580
     * Persist's the passed product integer attribute.
581
     *
582
     * @param array $attribute The attribute to persist
583
     *
584
     * @return void
585
     */
586
    public function persistProductIntAttribute($attribute)
587
    {
588
        $this->getProductProcessor()->persistProductIntAttribute($attribute);
589
    }
590
591
    /**
592
     * Persist's the passed product decimal attribute.
593
     *
594
     * @param array $attribute The attribute to persist
595
     *
596
     * @return void
597
     */
598
    public function persistProductDecimalAttribute($attribute)
599
    {
600
        $this->getProductProcessor()->persistProductDecimalAttribute($attribute);
601
    }
602
603
    /**
604
     * Persist's the passed product datetime attribute.
605
     *
606
     * @param array $attribute The attribute to persist
607
     *
608
     * @return void
609
     */
610
    public function persistProductDatetimeAttribute($attribute)
611
    {
612
        $this->getProductProcessor()->persistProductDatetimeAttribute($attribute);
613
    }
614
615
    /**
616
     * Persist's the passed product text attribute.
617
     *
618
     * @param array $attribute The attribute to persist
619
     *
620
     * @return void
621
     */
622
    public function persistProductTextAttribute($attribute)
623
    {
624
        $this->getProductProcessor()->persistProductTextAttribute($attribute);
625
    }
626
627
    /**
628
     * Persist's the passed product website data and return's the ID.
629
     *
630
     * @param array $productWebsite The product website data to persist
631
     *
632
     * @return void
633
     */
634
    public function persistProductWebsite($productWebsite)
635
    {
636
        $this->getProductProcessor()->persistProductWebsite($productWebsite);
637
    }
638
639
    /**
640
     * Persist's the passed category product relation.
641
     *
642
     * @param array $categoryProduct The category product relation to persist
643
     *
644
     * @return void
645
     */
646
    public function persistCategoryProduct($categoryProduct)
647
    {
648
        $this->getProductProcessor()->persistCategoryProduct($categoryProduct);
649
    }
650
651
    /**
652
     * Persist's the passed stock item data and return's the ID.
653
     *
654
     * @param array $stockItem The stock item data to persist
655
     *
656
     * @return void
657
     */
658
    public function persistStockItem($stockItem)
659
    {
660
        $this->getProductProcessor()->persistStockItem($stockItem);
661
    }
662
663
    /**
664
     * Persist's the passed stock status data and return's the ID.
665
     *
666
     * @param array $stockStatus The stock status data to persist
667
     *
668
     * @return void
669
     */
670
    public function persistStockStatus($stockStatus)
671
    {
672
        $this->getProductProcessor()->persistStockStatus($stockStatus);
673
    }
674
675
    /**
676
     * Persist's the URL rewrite with the passed data.
677
     *
678
     * @param array $row The URL rewrite to persist
679
     *
680
     * @return string The ID of the persisted entity
681
     */
682 1
    public function persistUrlRewrite($row)
683
    {
684 1
        return $this->getProductProcessor()->persistUrlRewrite($row);
685
    }
686
687
    /**
688
     * Persist's the URL rewrite product => category relation with the passed data.
689
     *
690
     * @param array $row The URL rewrite product => category relation to persist
691
     *
692
     * @return void
693
     */
694
    public function persistUrlRewriteProductCategory($row)
695
    {
696
        $this->getProductProcessor()->persistUrlRewriteProductCategory($row);
697
    }
698
699
    /**
700
     * Delete's the entity with the passed attributes.
701
     *
702
     * @param array       $row  The attributes of the entity to delete
703
     * @param string|null $name The name of the prepared statement that has to be executed
704
     *
705
     * @return void
706
     */
707
    public function deleteProduct($row, $name = null)
708
    {
709
        $this->getProductProcessor()->deleteProduct($row, $name);
710
    }
711
712
    /**
713
     * Delete's the URL rewrite(s) with the passed attributes.
714
     *
715
     * @param array       $row  The attributes of the entity to delete
716
     * @param string|null $name The name of the prepared statement that has to be executed
717
     *
718
     * @return void
719
     */
720 1
    public function deleteUrlRewrite($row, $name = null)
721
    {
722 1
        $this->getProductProcessor()->deleteUrlRewrite($row, $name);
723 1
    }
724
725
    /**
726
     * Delete's the stock item(s) with the passed attributes.
727
     *
728
     * @param array       $row  The attributes of the entity to delete
729
     * @param string|null $name The name of the prepared statement that has to be executed
730
     *
731
     * @return void
732
     */
733
    public function deleteStockItem($row, $name = null)
734
    {
735
        $this->getProductProcessor()->deleteStockItem($row, $name);
736
    }
737
738
    /**
739
     * Delete's the stock status with the passed attributes.
740
     *
741
     * @param array       $row  The attributes of the entity to delete
742
     * @param string|null $name The name of the prepared statement that has to be executed
743
     *
744
     * @return void
745
     */
746
    public function deleteStockStatus($row, $name = null)
747
    {
748
        $this->getProductProcessor()->deleteStockStatus($row, $name);
749
    }
750
751
    /**
752
     * Delete's the product website relations with the passed attributes.
753
     *
754
     * @param array       $row  The attributes of the entity to delete
755
     * @param string|null $name The name of the prepared statement that has to be executed
756
     *
757
     * @return void
758
     */
759
    public function deleteProductWebsite($row, $name = null)
760
    {
761
        $this->getProductProcessor()->deleteProductWebsite($row, $name);
762
    }
763
764
    /**
765
     * Delete's the category product relations with the passed attributes.
766
     *
767
     * @param array       $row  The attributes of the entity to delete
768
     * @param string|null $name The name of the prepared statement that has to be executed
769
     *
770
     * @return void
771
     */
772
    public function deleteCategoryProduct($row, $name = null)
773
    {
774
        $this->getProductProcessor()->deleteCategoryProduct($row, $name);
775
    }
776
}
777