Completed
Push — master ( 36cf1a...33368a )
by Tim
11s
created

BunchSubject::loadProductTextAttribute()   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
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
     * @param integer $pk     The PK the URL key is related with
277
     *
278
     * @return string The unique URL key
279
     */
280
    public function makeUrlKeyUnique($urlKey, $pk)
281
    {
282
283
        // initialize the entity type ID
284
        $entityType = $this->getEntityType();
285
        $entityTypeId = $entityType[MemberNames::ENTITY_TYPE_ID];
286
287
        // initialize the query parameters
288
        $storeId = $this->getRowStoreId(StoreViewCodes::ADMIN);
289
290
        // initialize the counter
291
        $counter = 0;
292
293
        // initialize the counters
294
        $matchingCounters = array();
295
        $notMatchingCounters = array();
296
297
        // pre-initialze the URL key to query for
298
        $value = $urlKey;
299
300
        do {
301
            // try to load the attribute
302
            $productVarcharAttribute = $this->getProductProcessor()
303
                                            ->loadProductVarcharAttributeByAttributeCodeAndEntityTypeIdAndStoreIdAndValue(
304
                                                MemberNames::URL_KEY,
305
                                                $entityTypeId,
306
                                                $storeId,
307
                                                $value
308
                                            );
309
310
            // try to load the product's URL key
311
            if ($productVarcharAttribute) {
312
                // this IS the URL key of the passed entity
313
                if ($this->isUrlKeyOf($productVarcharAttribute, $pk)) {
314
                    $matchingCounters[] = $counter;
315
                } else {
316
                    $notMatchingCounters[] = $counter;
317
                }
318
319
                // prepare the next URL key to query for
320
                $value = sprintf('%s-%d', $urlKey, ++$counter);
321
            }
322
0 ignored issues
show
Coding Style introduced by
Blank line found at end of control structure
Loading history...
323
        } while ($productVarcharAttribute);
324
325
        // sort the array ascending according to the counter
326
        asort($matchingCounters);
327
        asort($notMatchingCounters);
328
329
        // this IS the URL key of the passed entity => we've an UPDATE
330
        if (sizeof($matchingCounters) > 0) {
331
            // load highest counter
332
            $counter = end($matchingCounters);
333
            // if the counter is > 0, we've to append it to the new URL key
334
            if ($counter > 0) {
335
                return sprintf('%s-%d', $urlKey, $counter);
336
            }
337
        } elseif (sizeof($notMatchingCounters) > 0) {
338
            // create a new URL key by raising the counter
339
            $newCounter = end($notMatchingCounters);
340
            return sprintf('%s-%d', $urlKey, ++$newCounter);
341
        }
342
343
        // return the passed URL key, if NOT
344
        return $urlKey;
345
    }
346
347
    /**
348
     * Return's the entity type for the configured entity type code.
349
     *
350
     * @return array The requested entity type
351
     * @throws \Exception Is thrown, if the requested entity type is not available
352
     */
353 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...
354
    {
355
356
        // query whether or not the entity type with the passed code is available
357
        if (isset($this->entityTypes[$entityTypeCode = $this->getEntityTypeCode()])) {
358
            return $this->entityTypes[$entityTypeCode];
359
        }
360
361
        // throw a new exception
362
        throw new \Exception(
363
            $this->appendExceptionSuffix(
364
                sprintf('Requested entity type "%s" is not available', $entityTypeCode)
365
            )
366
        );
367
    }
368
369
    /**
370
     * Return's TRUE, if the passed URL key varchar value IS related with the passed PK.
371
     *
372
     * @param array   $productVarcharAttribute The varchar value to check
373
     * @param integer $pk                      The primary key to check
374
     *
375
     * @return boolean TRUE if the URL key is related, else FALSE
376
     */
377
    protected function isUrlKeyOf(array $productVarcharAttribute, $pk)
378
    {
379
        return $productVarcharAttribute[MemberNames::ENTITY_ID] === $pk;
380
    }
381
382
    /**
383
     * Return's an array with the available EAV attributes for the passed is user defined flag.
384
     *
385
     * @param integer $isUserDefined The flag itself
386
     *
387
     * @return array The array with the EAV attributes matching the passed flag
388
     */
389
    public function getEavAttributeByIsUserDefined($isUserDefined = 1)
390
    {
391
        return $this->getProductProcessor()->getEavAttributeByIsUserDefined($isUserDefined);
392
    }
393
394
    /**
395
     * Return's the URL rewrites for the passed URL entity type and ID.
396
     *
397
     * @param string  $entityType The entity type to load the URL rewrites for
398
     * @param integer $entityId   The entity ID to laod the rewrites for
399
     *
400
     * @return array The URL rewrites
401
     */
402 1
    public function getUrlRewritesByEntityTypeAndEntityId($entityType, $entityId)
403
    {
404 1
        return $this->getProductProcessor()->getUrlRewritesByEntityTypeAndEntityId($entityType, $entityId);
405
    }
406
407
    /**
408
     * Load's and return's the product with the passed SKU.
409
     *
410
     * @param string $sku The SKU of the product to load
411
     *
412
     * @return array The product
413
     */
414
    public function loadProduct($sku)
415
    {
416
        return $this->getProductProcessor()->loadProduct($sku);
417
    }
418
419
    /**
420
     * Load's and return's the product website relation with the passed product and website ID.
421
     *
422
     * @param string $productId The product ID of the relation
423
     * @param string $websiteId The website ID of the relation
424
     *
425
     * @return array The product website
426
     */
427
    public function loadProductWebsite($productId, $websiteId)
428
    {
429
        return $this->getProductProcessor()->loadProductWebsite($productId, $websiteId);
430
    }
431
432
    /**
433
     * Return's the category product relation with the passed category/product ID.
434
     *
435
     * @param integer $categoryId The category ID of the category product relation to return
436
     * @param integer $productId  The product ID of the category product relation to return
437
     *
438
     * @return array The category product relation
439
     */
440
    public function loadCategoryProduct($categoryId, $productId)
441
    {
442
        return $this->getProductProcessor()->loadCategoryProduct($categoryId, $productId);
443
    }
444
445
    /**
446
     * Load's and return's the stock status with the passed product/website/stock ID.
447
     *
448
     * @param integer $productId The product ID of the stock status to load
449
     * @param integer $websiteId The website ID of the stock status to load
450
     * @param integer $stockId   The stock ID of the stock status to load
451
     *
452
     * @return array The stock status
453
     */
454
    public function loadStockStatus($productId, $websiteId, $stockId)
455
    {
456
        return $this->getProductProcessor()->loadStockStatus($productId, $websiteId, $stockId);
457
    }
458
459
    /**
460
     * Load's and return's the stock status with the passed product/website/stock ID.
461
     *
462
     * @param integer $productId The product ID of the stock item to load
463
     * @param integer $websiteId The website ID of the stock item to load
464
     * @param integer $stockId   The stock ID of the stock item to load
465
     *
466
     * @return array The stock item
467
     */
468
    public function loadStockItem($productId, $websiteId, $stockId)
469
    {
470
        return $this->getProductProcessor()->loadStockItem($productId, $websiteId, $stockId);
471
    }
472
473
    /**
474
     * Load's and return's the datetime attribute with the passed entity/attribute/store ID.
475
     *
476
     * @param integer $entityId    The entity ID of the attribute
477
     * @param integer $attributeId The attribute ID of the attribute
478
     * @param integer $storeId     The store ID of the attribute
479
     *
480
     * @return array|null The datetime attribute
481
     */
482
    public function loadProductDatetimeAttribute($entityId, $attributeId, $storeId)
483
    {
484
        return $this->getProductProcessor()->loadProductDatetimeAttribute($entityId, $attributeId, $storeId);
485
    }
486
487
    /**
488
     * Load's and return's the decimal attribute with the passed entity/attribute/store ID.
489
     *
490
     * @param integer $entityId    The entity ID of the attribute
491
     * @param integer $attributeId The attribute ID of the attribute
492
     * @param integer $storeId     The store ID of the attribute
493
     *
494
     * @return array|null The decimal attribute
495
     */
496
    public function loadProductDecimalAttribute($entityId, $attributeId, $storeId)
497
    {
498
        return $this->getProductProcessor()->loadProductDecimalAttribute($entityId, $attributeId, $storeId);
499
    }
500
501
    /**
502
     * Load's and return's the integer attribute with the passed entity/attribute/store ID.
503
     *
504
     * @param integer $entityId    The entity ID of the attribute
505
     * @param integer $attributeId The attribute ID of the attribute
506
     * @param integer $storeId     The store ID of the attribute
507
     *
508
     * @return array|null The integer attribute
509
     */
510
    public function loadProductIntAttribute($entityId, $attributeId, $storeId)
511
    {
512
        return $this->getProductProcessor()->loadProductIntAttribute($entityId, $attributeId, $storeId);
513
    }
514
515
    /**
516
     * Load's and return's the text attribute with the passed entity/attribute/store ID.
517
     *
518
     * @param integer $entityId    The entity ID of the attribute
519
     * @param integer $attributeId The attribute ID of the attribute
520
     * @param integer $storeId     The store ID of the attribute
521
     *
522
     * @return array|null The text attribute
523
     */
524
    public function loadProductTextAttribute($entityId, $attributeId, $storeId)
525
    {
526
        return $this->getProductProcessor()->loadProductTextAttribute($entityId, $attributeId, $storeId);
527
    }
528
529
    /**
530
     * Load's and return's the varchar attribute with the passed entity/attribute/store ID.
531
     *
532
     * @param integer $entityId    The entity ID of the attribute
533
     * @param integer $attributeId The attribute ID of the attribute
534
     * @param integer $storeId     The store ID of the attribute
535
     *
536
     * @return array|null The varchar attribute
537
     */
538
    public function loadProductVarcharAttribute($entityId, $attributeId, $storeId)
539
    {
540
        return $this->getProductProcessor()->loadProductVarcharAttribute($entityId, $attributeId, $storeId);
541
    }
542
543
    /**
544
     * Return's the URL rewrite product category relation for the passed
545
     * product and category ID.
546
     *
547
     * @param integer $productId  The product ID to load the URL rewrite product category relation for
548
     * @param integer $categoryId The category ID to load the URL rewrite product category relation for
549
     *
550
     * @return array|false The URL rewrite product category relations
551
     */
552
    public function loadUrlRewriteProductCategory($productId, $categoryId)
553
    {
554
        return $this->getProductProcessor()->loadUrlRewriteProductCategory($productId, $categoryId);
555
    }
556
557
    /**
558
     * Persist's the passed product data and return's the ID.
559
     *
560
     * @param array $product The product data to persist
561
     *
562
     * @return string The ID of the persisted entity
563
     */
564
    public function persistProduct($product)
565
    {
566
        return $this->getProductProcessor()->persistProduct($product);
567
    }
568
569
    /**
570
     * Persist's the passed product varchar attribute.
571
     *
572
     * @param array $attribute The attribute to persist
573
     *
574
     * @return void
575
     */
576
    public function persistProductVarcharAttribute($attribute)
577
    {
578
        $this->getProductProcessor()->persistProductVarcharAttribute($attribute);
579
    }
580
581
    /**
582
     * Persist's the passed product integer attribute.
583
     *
584
     * @param array $attribute The attribute to persist
585
     *
586
     * @return void
587
     */
588
    public function persistProductIntAttribute($attribute)
589
    {
590
        $this->getProductProcessor()->persistProductIntAttribute($attribute);
591
    }
592
593
    /**
594
     * Persist's the passed product decimal attribute.
595
     *
596
     * @param array $attribute The attribute to persist
597
     *
598
     * @return void
599
     */
600
    public function persistProductDecimalAttribute($attribute)
601
    {
602
        $this->getProductProcessor()->persistProductDecimalAttribute($attribute);
603
    }
604
605
    /**
606
     * Persist's the passed product datetime attribute.
607
     *
608
     * @param array $attribute The attribute to persist
609
     *
610
     * @return void
611
     */
612
    public function persistProductDatetimeAttribute($attribute)
613
    {
614
        $this->getProductProcessor()->persistProductDatetimeAttribute($attribute);
615
    }
616
617
    /**
618
     * Persist's the passed product text attribute.
619
     *
620
     * @param array $attribute The attribute to persist
621
     *
622
     * @return void
623
     */
624
    public function persistProductTextAttribute($attribute)
625
    {
626
        $this->getProductProcessor()->persistProductTextAttribute($attribute);
627
    }
628
629
    /**
630
     * Persist's the passed product website data and return's the ID.
631
     *
632
     * @param array $productWebsite The product website data to persist
633
     *
634
     * @return void
635
     */
636
    public function persistProductWebsite($productWebsite)
637
    {
638
        $this->getProductProcessor()->persistProductWebsite($productWebsite);
639
    }
640
641
    /**
642
     * Persist's the passed category product relation.
643
     *
644
     * @param array $categoryProduct The category product relation to persist
645
     *
646
     * @return void
647
     */
648
    public function persistCategoryProduct($categoryProduct)
649
    {
650
        $this->getProductProcessor()->persistCategoryProduct($categoryProduct);
651
    }
652
653
    /**
654
     * Persist's the passed stock item data and return's the ID.
655
     *
656
     * @param array $stockItem The stock item data to persist
657
     *
658
     * @return void
659
     */
660
    public function persistStockItem($stockItem)
661
    {
662
        $this->getProductProcessor()->persistStockItem($stockItem);
663
    }
664
665
    /**
666
     * Persist's the passed stock status data and return's the ID.
667
     *
668
     * @param array $stockStatus The stock status data to persist
669
     *
670
     * @return void
671
     */
672
    public function persistStockStatus($stockStatus)
673
    {
674
        $this->getProductProcessor()->persistStockStatus($stockStatus);
675
    }
676
677
    /**
678
     * Persist's the URL rewrite with the passed data.
679
     *
680
     * @param array $row The URL rewrite to persist
681
     *
682
     * @return string The ID of the persisted entity
683
     */
684 1
    public function persistUrlRewrite($row)
685
    {
686 1
        return $this->getProductProcessor()->persistUrlRewrite($row);
687
    }
688
689
    /**
690
     * Persist's the URL rewrite product => category relation with the passed data.
691
     *
692
     * @param array $row The URL rewrite product => category relation to persist
693
     *
694
     * @return void
695
     */
696
    public function persistUrlRewriteProductCategory($row)
697
    {
698
        $this->getProductProcessor()->persistUrlRewriteProductCategory($row);
699
    }
700
701
    /**
702
     * Delete's the entity with the passed attributes.
703
     *
704
     * @param array       $row  The attributes of the entity to delete
705
     * @param string|null $name The name of the prepared statement that has to be executed
706
     *
707
     * @return void
708
     */
709
    public function deleteProduct($row, $name = null)
710
    {
711
        $this->getProductProcessor()->deleteProduct($row, $name);
712
    }
713
714
    /**
715
     * Delete's the URL rewrite(s) with the passed attributes.
716
     *
717
     * @param array       $row  The attributes of the entity to delete
718
     * @param string|null $name The name of the prepared statement that has to be executed
719
     *
720
     * @return void
721
     */
722 1
    public function deleteUrlRewrite($row, $name = null)
723
    {
724 1
        $this->getProductProcessor()->deleteUrlRewrite($row, $name);
725 1
    }
726
727
    /**
728
     * Delete's the stock item(s) with the passed attributes.
729
     *
730
     * @param array       $row  The attributes of the entity to delete
731
     * @param string|null $name The name of the prepared statement that has to be executed
732
     *
733
     * @return void
734
     */
735
    public function deleteStockItem($row, $name = null)
736
    {
737
        $this->getProductProcessor()->deleteStockItem($row, $name);
738
    }
739
740
    /**
741
     * Delete's the stock status with the passed attributes.
742
     *
743
     * @param array       $row  The attributes of the entity to delete
744
     * @param string|null $name The name of the prepared statement that has to be executed
745
     *
746
     * @return void
747
     */
748
    public function deleteStockStatus($row, $name = null)
749
    {
750
        $this->getProductProcessor()->deleteStockStatus($row, $name);
751
    }
752
753
    /**
754
     * Delete's the product website relations with the passed attributes.
755
     *
756
     * @param array       $row  The attributes of the entity to delete
757
     * @param string|null $name The name of the prepared statement that has to be executed
758
     *
759
     * @return void
760
     */
761
    public function deleteProductWebsite($row, $name = null)
762
    {
763
        $this->getProductProcessor()->deleteProductWebsite($row, $name);
764
    }
765
766
    /**
767
     * Delete's the category product relations with the passed attributes.
768
     *
769
     * @param array       $row  The attributes of the entity to delete
770
     * @param string|null $name The name of the prepared statement that has to be executed
771
     *
772
     * @return void
773
     */
774
    public function deleteCategoryProduct($row, $name = null)
775
    {
776
        $this->getProductProcessor()->deleteCategoryProduct($row, $name);
777
    }
778
}
779