Completed
Push — master ( b3282a...39e6eb )
by Tim
10s
created

BunchSubject::loadProductDecimalAttribute()   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\Product\Utils\MemberNames;
24
use TechDivision\Import\Product\Utils\VisibilityKeys;
25
use TechDivision\Import\Subjects\ExportableTrait;
26
use TechDivision\Import\Subjects\ExportableSubjectInterface;
27
28
/**
29
 * The subject implementation that handles the business logic to persist products.
30
 *
31
 * @author    Tim Wagner <[email protected]>
32
 * @copyright 2016 TechDivision GmbH <[email protected]>
33
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
 * @link      https://github.com/techdivision/import-product
35
 * @link      http://www.techdivision.com
36
 */
37
class BunchSubject extends AbstractProductSubject implements ExportableSubjectInterface
38
{
39
40
    /**
41
     * The trait that implements the export functionality.
42
     *
43
     * @var \TechDivision\Import\Subjects\ExportableTrait
44
     */
45
    use ExportableTrait;
46
47
    /**
48
     * The mapping for the supported backend types (for the product entity) => persist methods.
49
     *
50
     * @var array
51
     */
52
    protected $backendTypes = array(
53
        'datetime' => array('persistProductDatetimeAttribute', 'loadProductDatetimeAttribute'),
54
        'decimal'  => array('persistProductDecimalAttribute', 'loadProductDecimalAttribute'),
55
        'int'      => array('persistProductIntAttribute', 'loadProductIntAttribute'),
56
        'text'     => array('persistProductTextAttribute', 'loadProductTextAttribute'),
57
        'varchar'  => array('persistProductVarcharAttribute', 'loadProductVarcharAttribute')
58
    );
59
60
    /**
61
     * Mappings for the table column => CSV column header.
62
     *
63
     * @var array
64
     */
65
    protected $headerStockMappings = array(
66
        'qty'                         => array('qty', 'float'),
67
        'min_qty'                     => array('out_of_stock_qty', 'float'),
68
        'use_config_min_qty'          => array('use_config_min_qty', 'int'),
69
        'is_qty_decimal'              => array('is_qty_decimal', 'int'),
70
        'backorders'                  => array('allow_backorders', 'int'),
71
        'use_config_backorders'       => array('use_config_backorders', 'int'),
72
        'min_sale_qty'                => array('min_cart_qty', 'float'),
73
        'use_config_min_sale_qty'     => array('use_config_min_sale_qty', 'int'),
74
        'max_sale_qty'                => array('max_cart_qty', 'float'),
75
        'use_config_max_sale_qty'     => array('use_config_max_sale_qty', 'int'),
76
        'is_in_stock'                 => array('is_in_stock', 'int'),
77
        'notify_stock_qty'            => array('notify_on_stock_below', 'float'),
78
        'use_config_notify_stock_qty' => array('use_config_notify_stock_qty', 'int'),
79
        'manage_stock'                => array('manage_stock', 'int'),
80
        'use_config_manage_stock'     => array('use_config_manage_stock', 'int'),
81
        'use_config_qty_increments'   => array('use_config_qty_increments', 'int'),
82
        'qty_increments'              => array('qty_increments', 'float'),
83
        'use_config_enable_qty_inc'   => array('use_config_enable_qty_inc', 'int'),
84
        'enable_qty_increments'       => array('enable_qty_increments', 'int'),
85
        'is_decimal_divided'          => array('is_decimal_divided', 'int'),
86
    );
87
88
    /**
89
     * The array with the available visibility keys.
90
     *
91
     * @var array
92
     */
93
    protected $availableVisibilities = array(
94
        'Not Visible Individually' => VisibilityKeys::VISIBILITY_NOT_VISIBLE,
95
        'Catalog'                  => VisibilityKeys::VISIBILITY_IN_CATALOG,
96
        'Search'                   => VisibilityKeys::VISIBILITY_IN_SEARCH,
97
        'Catalog, Search'          => VisibilityKeys::VISIBILITY_BOTH
98
    );
99
100
    /**
101
     * The category IDs the product is related with.
102
     *
103
     * @var array
104
     */
105
    protected $productCategoryIds = array();
106
107
    /**
108
     * The default mappings for the user defined attributes, based on the attributes frontend input type.
109
     *
110
     * @var array
111
     */
112
    protected $defaultFrontendInputCallbackMapping = array(
113
        'select' => 'TechDivision\\Import\\Product\\Callbacks\\SelectCallback',
114
        'multiselect' => 'TechDivision\\Import\\Product\\Callbacks\\MultiselectCallback',
115
        'boolean' => 'TechDivision\\Import\\Product\\Callbacks\\BooleanCallback'
116
    );
117
118
    /**
119
     * The default callback mappings for the Magento standard product attributes.
120
     *
121
     * @var array
122
     */
123
    protected $defaultCallbackMappings = array(
124
        'visibility'           => array('TechDivision\\Import\\Product\\Callbacks\\VisibilityCallback'),
125
        'tax_class_id'         => array('TechDivision\\Import\\Product\\Callbacks\\TaxClassCallback'),
126
        'bundle_price_type'    => array('TechDivision\\Import\\Product\\Bundle\\Callbacks\\BundleTypeCallback'),
127
        'bundle_sku_type'      => array('TechDivision\\Import\\Product\\Bundle\\Callbacks\\BundleTypeCallback'),
128
        'bundle_weight_type'   => array('TechDivision\\Import\\Product\\Bundle\\Callbacks\\BundleTypeCallback'),
129
        'bundle_price_view'    => array('TechDivision\\Import\\Product\\Bundle\\Callbacks\\BundlePriceViewCallback'),
130
        'bundle_shipment_type' => array('TechDivision\\Import\\Product\\Bundle\\Callbacks\\BundleShipmentTypeCallback')
131
    );
132
133
    /**
134
     * Intializes the previously loaded global data for exactly one bunch.
135
     *
136
     * @return void
137
     * @see \Importer\Csv\Actions\ProductImportAction::prepare()
138
     */
139
    public function setUp()
140
    {
141
142
        // initialize the callback mappings with the default mappings
143
        $this->callbackMappings = array_merge($this->callbackMappings, $this->defaultCallbackMappings);
0 ignored issues
show
Bug introduced by
The property callbackMappings does not seem to exist. Did you mean defaultCallbackMappings?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
144
145
        // load the user defined attributes and add the callback mappings
146
        foreach ($this->getEavAttributeByIsUserDefined() as $eavAttribute) {
147
            // load attribute code and frontend input type
148
            $attributeCode = $eavAttribute[MemberNames::ATTRIBUTE_CODE];
149
            $frontendInput = $eavAttribute[MemberNames::FRONTEND_INPUT];
150
151
            // query whether or not the array for the mappings has been initialized
152
            if (!isset($this->callbackMappings[$attributeCode])) {
0 ignored issues
show
Bug introduced by
The property callbackMappings does not seem to exist. Did you mean defaultCallbackMappings?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
153
                $this->callbackMappings[$attributeCode] = array();
0 ignored issues
show
Bug introduced by
The property callbackMappings does not seem to exist. Did you mean defaultCallbackMappings?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
154
            }
155
156
            // set the appropriate callback mapping for the attributes input type
157
            if (isset($this->defaultFrontendInputCallbackMapping[$frontendInput])) {
158
                $this->callbackMappings[$attributeCode][] = $this->defaultFrontendInputCallbackMapping[$frontendInput];
0 ignored issues
show
Bug introduced by
The property callbackMappings does not seem to exist. Did you mean defaultCallbackMappings?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
159
            }
160
        }
161
162
        // merge the callback mappings the the one from the configuration file
163
        foreach ($this->getConfiguration()->getCallbacks() as $callbackMappings) {
164
            foreach ($callbackMappings as $attributeCode => $mappings) {
165
                // write a log message, that default callback configuration will
166
                // be overwritten with the one from the configuration file
167
                if (isset($this->callbackMappings[$attributeCode])) {
0 ignored issues
show
Bug introduced by
The property callbackMappings does not seem to exist. Did you mean defaultCallbackMappings?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
168
                    $this->getSystemLogger()->notice(
169
                        sprintf('Now override callback mappings for attribute %s with values found in configuration file', $attributeCode)
170
                    );
171
                }
172
173
                // override the attributes callbacks
174
                $this->callbackMappings[$attributeCode] = $mappings;
0 ignored issues
show
Bug introduced by
The property callbackMappings does not seem to exist. Did you mean defaultCallbackMappings?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
175
            }
176
        }
177
178
        // invoke the parent method
179
        parent::setUp();
180
    }
181
182
    /**
183
     * Cast's the passed value based on the backend type information.
184
     *
185
     * @param string $backendType The backend type to cast to
186
     * @param mixed  $value       The value to be casted
187
     *
188
     * @return mixed The casted value
189
     */
190 1
    public function castValueByBackendType($backendType, $value)
191
    {
192
193
        // cast the value to a valid timestamp
194 1
        if ($backendType === 'datetime') {
195
            return \DateTime::createFromFormat($this->getSourceDateFormat(), $value)->format('Y-m-d H:i:s');
196
        }
197
198
        // cast the value to a float value
199 1
        if ($backendType === 'float') {
200 1
            return (float) $value;
201
        }
202
203
        // cast the value to an integer
204 1
        if ($backendType === 'int') {
205 1
            return (int) $value;
206
        }
207
208
        // we don't need to cast strings
209
        return $value;
210
    }
211
212
    /**
213
     * Return's the mappings for the table column => CSV column header.
214
     *
215
     * @return array The header stock mappings
216
     */
217 1
    public function getHeaderStockMappings()
218
    {
219 1
        return $this->headerStockMappings;
220
    }
221
222
    /**
223
     * Return's mapping for the supported backend types (for the product entity) => persist methods.
224
     *
225
     * @return array The mapping for the supported backend types
226
     */
227
    public function getBackendTypes()
228
    {
229
        return $this->backendTypes;
230
    }
231
232
    /**
233
     * Return's the visibility key for the passed visibility string.
234
     *
235
     * @param string $visibility The visibility string to return the key for
236
     *
237
     * @return integer The requested visibility key
238
     * @throws \Exception Is thrown, if the requested visibility is not available
239
     */
240 View Code Duplication
    public function getVisibilityIdByValue($visibility)
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...
241
    {
242
243
        // query whether or not, the requested visibility is available
244
        if (isset($this->availableVisibilities[$visibility])) {
245
            return $this->availableVisibilities[$visibility];
246
        }
247
248
        // throw an exception, if not
249
        throw new \Exception(
250
            sprintf(
251
                'Found invalid visibility %s in file %s on line %d',
252
                $visibility,
253
                $this->getFilename(),
254
                $this->getLineNumber()
255
            )
256
        );
257
    }
258
259
    /**
260
     * Add the passed category ID to the product's category list.
261
     *
262
     * @param integer $categoryId The category ID to add
263
     *
264
     * @return void
265
     */
266
    public function addProductCategoryId($categoryId)
267
    {
268
        $this->productCategoryIds[$this->getLastEntityId()][$categoryId] = $this->getLastEntityId();
269
    }
270
271
    /**
272
     * Return's the list with category IDs the product is related with.
273
     *
274
     * @return array The product's category IDs
275
     */
276
    public function getProductCategoryIds()
277
    {
278
279
        // initialize the array with the product's category IDs
280
        $categoryIds = array();
281
282
        // query whether or not category IDs are available for the actual product entity
283
        if (isset($this->productCategoryIds[$lastEntityId = $this->getLastEntityId()])) {
284
            $categoryIds = $this->productCategoryIds[$lastEntityId];
285
        }
286
287
        // return the array with the product's category IDs
288
        return $categoryIds;
289
    }
290
291
    /**
292
     * Return's the attribute option value with the passed value and store ID.
293
     *
294
     * @param mixed   $value   The option value
295
     * @param integer $storeId The ID of the store
296
     *
297
     * @return array|boolean The attribute option value instance
298
     */
299
    public function getEavAttributeOptionValueByOptionValueAndStoreId($value, $storeId)
300
    {
301
        return $this->getProductProcessor()->getEavAttributeOptionValueByOptionValueAndStoreId($value, $storeId);
302
    }
303
304
    /**
305
     * Return's an array with the available EAV attributes for the passed is user defined flag.
306
     *
307
     * @param integer $isUserDefined The flag itself
308
     *
309
     * @return array The array with the EAV attributes matching the passed flag
310
     */
311
    public function getEavAttributeByIsUserDefined($isUserDefined = 1)
312
    {
313
        return $this->getProductProcessor()->getEavAttributeByIsUserDefined($isUserDefined);
314
    }
315
316
    /**
317
     * Return's the URL rewrites for the passed URL entity type and ID.
318
     *
319
     * @param string  $entityType The entity type to load the URL rewrites for
320
     * @param integer $entityId   The entity ID to laod the rewrites for
321
     *
322
     * @return array The URL rewrites
323
     */
324 1
    public function getUrlRewritesByEntityTypeAndEntityId($entityType, $entityId)
325
    {
326 1
        return $this->getProductProcessor()->getUrlRewritesByEntityTypeAndEntityId($entityType, $entityId);
327
    }
328
329
    /**
330
     * Load's and return's the product with the passed SKU.
331
     *
332
     * @param string $sku The SKU of the product to load
333
     *
334
     * @return array The product
335
     */
336
    public function loadProduct($sku)
337
    {
338
        return $this->getProductProcessor()->loadProduct($sku);
339
    }
340
341
    /**
342
     * Load's and return's the product website relation with the passed product and website ID.
343
     *
344
     * @param string $productId The product ID of the relation
345
     * @param string $websiteId The website ID of the relation
346
     *
347
     * @return array The product website
348
     */
349
    public function loadProductWebsite($productId, $websiteId)
350
    {
351
        return $this->getProductProcessor()->loadProductWebsite($productId, $websiteId);
352
    }
353
354
    /**
355
     * Return's the category product relation with the passed category/product ID.
356
     *
357
     * @param integer $categoryId The category ID of the category product relation to return
358
     * @param integer $productId  The product ID of the category product relation to return
359
     *
360
     * @return array The category product relation
361
     */
362
    public function loadCategoryProduct($categoryId, $productId)
363
    {
364
        return $this->getProductProcessor()->loadCategoryProduct($categoryId, $productId);
365
    }
366
367
    /**
368
     * Load's and return's the stock status with the passed product/website/stock ID.
369
     *
370
     * @param integer $productId The product ID of the stock status to load
371
     * @param integer $websiteId The website ID of the stock status to load
372
     * @param integer $stockId   The stock ID of the stock status to load
373
     *
374
     * @return array The stock status
375
     */
376
    public function loadStockStatus($productId, $websiteId, $stockId)
377
    {
378
        return $this->getProductProcessor()->loadStockStatus($productId, $websiteId, $stockId);
379
    }
380
381
    /**
382
     * Load's and return's the stock status with the passed product/website/stock ID.
383
     *
384
     * @param integer $productId The product ID of the stock item to load
385
     * @param integer $websiteId The website ID of the stock item to load
386
     * @param integer $stockId   The stock ID of the stock item to load
387
     *
388
     * @return array The stock item
389
     */
390
    public function loadStockItem($productId, $websiteId, $stockId)
391
    {
392
        return $this->getProductProcessor()->loadStockItem($productId, $websiteId, $stockId);
393
    }
394
395
    /**
396
     * Load's and return's the datetime attribute with the passed entity/attribute/store ID.
397
     *
398
     * @param integer $entityId    The entity ID of the attribute
399
     * @param integer $attributeId The attribute ID of the attribute
400
     * @param integer $storeId     The store ID of the attribute
401
     *
402
     * @return array|null The datetime attribute
403
     */
404
    public function loadProductDatetimeAttribute($entityId, $attributeId, $storeId)
405
    {
406
        return $this->getProductProcessor()->loadProductDatetimeAttribute($entityId, $attributeId, $storeId);
407
    }
408
409
    /**
410
     * Load's and return's the decimal attribute with the passed entity/attribute/store ID.
411
     *
412
     * @param integer $entityId    The entity ID of the attribute
413
     * @param integer $attributeId The attribute ID of the attribute
414
     * @param integer $storeId     The store ID of the attribute
415
     *
416
     * @return array|null The decimal attribute
417
     */
418
    public function loadProductDecimalAttribute($entityId, $attributeId, $storeId)
419
    {
420
        return $this->getProductProcessor()->loadProductDecimalAttribute($entityId, $attributeId, $storeId);
421
    }
422
423
    /**
424
     * Load's and return's the integer attribute with the passed entity/attribute/store ID.
425
     *
426
     * @param integer $entityId    The entity ID of the attribute
427
     * @param integer $attributeId The attribute ID of the attribute
428
     * @param integer $storeId     The store ID of the attribute
429
     *
430
     * @return array|null The integer attribute
431
     */
432
    public function loadProductIntAttribute($entityId, $attributeId, $storeId)
433
    {
434
        return $this->getProductProcessor()->loadProductIntAttribute($entityId, $attributeId, $storeId);
435
    }
436
437
    /**
438
     * Load's and return's the text attribute with the passed entity/attribute/store ID.
439
     *
440
     * @param integer $entityId    The entity ID of the attribute
441
     * @param integer $attributeId The attribute ID of the attribute
442
     * @param integer $storeId     The store ID of the attribute
443
     *
444
     * @return array|null The text attribute
445
     */
446
    public function loadProductTextAttribute($entityId, $attributeId, $storeId)
447
    {
448
        return $this->getProductProcessor()->loadProductTextAttribute($entityId, $attributeId, $storeId);
449
    }
450
451
    /**
452
     * Load's and return's the varchar attribute with the passed entity/attribute/store ID.
453
     *
454
     * @param integer $entityId    The entity ID of the attribute
455
     * @param integer $attributeId The attribute ID of the attribute
456
     * @param integer $storeId     The store ID of the attribute
457
     *
458
     * @return array|null The varchar attribute
459
     */
460
    public function loadProductVarcharAttribute($entityId, $attributeId, $storeId)
461
    {
462
        return $this->getProductProcessor()->loadProductVarcharAttribute($entityId, $attributeId, $storeId);
463
    }
464
465
    /**
466
     * Return's the URL rewrite product category relation for the passed
467
     * product and category ID.
468
     *
469
     * @param integer $productId  The product ID to load the URL rewrite product category relation for
470
     * @param integer $categoryId The category ID to load the URL rewrite product category relation for
471
     *
472
     * @return array|false The URL rewrite product category relations
473
     */
474
    public function loadUrlRewriteProductCategory($productId, $categoryId)
475
    {
476
        return $this->getProductProcessor()->loadUrlRewriteProductCategory($productId, $categoryId);
477
    }
478
479
    /**
480
     * Persist's the passed product data and return's the ID.
481
     *
482
     * @param array $product The product data to persist
483
     *
484
     * @return string The ID of the persisted entity
485
     */
486
    public function persistProduct($product)
487
    {
488
        return $this->getProductProcessor()->persistProduct($product);
489
    }
490
491
    /**
492
     * Persist's the passed product varchar attribute.
493
     *
494
     * @param array $attribute The attribute to persist
495
     *
496
     * @return void
497
     */
498
    public function persistProductVarcharAttribute($attribute)
499
    {
500
        $this->getProductProcessor()->persistProductVarcharAttribute($attribute);
501
    }
502
503
    /**
504
     * Persist's the passed product integer attribute.
505
     *
506
     * @param array $attribute The attribute to persist
507
     *
508
     * @return void
509
     */
510
    public function persistProductIntAttribute($attribute)
511
    {
512
        $this->getProductProcessor()->persistProductIntAttribute($attribute);
513
    }
514
515
    /**
516
     * Persist's the passed product decimal attribute.
517
     *
518
     * @param array $attribute The attribute to persist
519
     *
520
     * @return void
521
     */
522
    public function persistProductDecimalAttribute($attribute)
523
    {
524
        $this->getProductProcessor()->persistProductDecimalAttribute($attribute);
525
    }
526
527
    /**
528
     * Persist's the passed product datetime attribute.
529
     *
530
     * @param array $attribute The attribute to persist
531
     *
532
     * @return void
533
     */
534
    public function persistProductDatetimeAttribute($attribute)
535
    {
536
        $this->getProductProcessor()->persistProductDatetimeAttribute($attribute);
537
    }
538
539
    /**
540
     * Persist's the passed product text attribute.
541
     *
542
     * @param array $attribute The attribute to persist
543
     *
544
     * @return void
545
     */
546
    public function persistProductTextAttribute($attribute)
547
    {
548
        $this->getProductProcessor()->persistProductTextAttribute($attribute);
549
    }
550
551
    /**
552
     * Persist's the passed product website data and return's the ID.
553
     *
554
     * @param array $productWebsite The product website data to persist
555
     *
556
     * @return void
557
     */
558
    public function persistProductWebsite($productWebsite)
559
    {
560
        $this->getProductProcessor()->persistProductWebsite($productWebsite);
561
    }
562
563
    /**
564
     * Persist's the passed category product relation.
565
     *
566
     * @param array $categoryProduct The category product relation to persist
567
     *
568
     * @return void
569
     */
570
    public function persistCategoryProduct($categoryProduct)
571
    {
572
        $this->getProductProcessor()->persistCategoryProduct($categoryProduct);
573
    }
574
575
    /**
576
     * Persist's the passed stock item data and return's the ID.
577
     *
578
     * @param array $stockItem The stock item data to persist
579
     *
580
     * @return void
581
     */
582
    public function persistStockItem($stockItem)
583
    {
584
        $this->getProductProcessor()->persistStockItem($stockItem);
585
    }
586
587
    /**
588
     * Persist's the passed stock status data and return's the ID.
589
     *
590
     * @param array $stockStatus The stock status data to persist
591
     *
592
     * @return void
593
     */
594
    public function persistStockStatus($stockStatus)
595
    {
596
        $this->getProductProcessor()->persistStockStatus($stockStatus);
597
    }
598
599
    /**
600
     * Persist's the URL rewrite with the passed data.
601
     *
602
     * @param array $row The URL rewrite to persist
603
     *
604
     * @return string The ID of the persisted entity
605
     */
606 1
    public function persistUrlRewrite($row)
607
    {
608 1
        return $this->getProductProcessor()->persistUrlRewrite($row);
609
    }
610
611
    /**
612
     * Persist's the URL rewrite product => category relation with the passed data.
613
     *
614
     * @param array $row The URL rewrite product => category relation to persist
615
     *
616
     * @return void
617
     */
618
    public function persistUrlRewriteProductCategory($row)
619
    {
620
        $this->getProductProcessor()->persistUrlRewriteProductCategory($row);
621
    }
622
623
    /**
624
     * Delete's the entity with the passed attributes.
625
     *
626
     * @param array       $row  The attributes of the entity to delete
627
     * @param string|null $name The name of the prepared statement that has to be executed
628
     *
629
     * @return void
630
     */
631
    public function deleteProduct($row, $name = null)
632
    {
633
        $this->getProductProcessor()->deleteProduct($row, $name);
634
    }
635
636
    /**
637
     * Delete's the URL rewrite(s) with the passed attributes.
638
     *
639
     * @param array       $row  The attributes of the entity to delete
640
     * @param string|null $name The name of the prepared statement that has to be executed
641
     *
642
     * @return void
643
     */
644 1
    public function deleteUrlRewrite($row, $name = null)
645
    {
646 1
        $this->getProductProcessor()->deleteUrlRewrite($row, $name);
647 1
    }
648
649
    /**
650
     * Delete's the stock item(s) with the passed attributes.
651
     *
652
     * @param array       $row  The attributes of the entity to delete
653
     * @param string|null $name The name of the prepared statement that has to be executed
654
     *
655
     * @return void
656
     */
657
    public function deleteStockItem($row, $name = null)
658
    {
659
        $this->getProductProcessor()->deleteStockItem($row, $name);
660
    }
661
662
    /**
663
     * Delete's the stock status with the passed attributes.
664
     *
665
     * @param array       $row  The attributes of the entity to delete
666
     * @param string|null $name The name of the prepared statement that has to be executed
667
     *
668
     * @return void
669
     */
670
    public function deleteStockStatus($row, $name = null)
671
    {
672
        $this->getProductProcessor()->deleteStockStatus($row, $name);
673
    }
674
675
    /**
676
     * Delete's the product website relations with the passed attributes.
677
     *
678
     * @param array       $row  The attributes of the entity to delete
679
     * @param string|null $name The name of the prepared statement that has to be executed
680
     *
681
     * @return void
682
     */
683
    public function deleteProductWebsite($row, $name = null)
684
    {
685
        $this->getProductProcessor()->deleteProductWebsite($row, $name);
686
    }
687
688
    /**
689
     * Delete's the category product relations with the passed attributes.
690
     *
691
     * @param array       $row  The attributes of the entity to delete
692
     * @param string|null $name The name of the prepared statement that has to be executed
693
     *
694
     * @return void
695
     */
696
    public function deleteCategoryProduct($row, $name = null)
697
    {
698
        $this->getProductProcessor()->deleteCategoryProduct($row, $name);
699
    }
700
}
701