Skip to content

Commit 14eb676

Browse files
Bigger Category collection class split into core sync and utility helper class (#504)
* Category collection class split into 2 small files * Comments addressed * supress warning added * Category repository get size issue removed * extra space removed
1 parent 2884bee commit 14eb676

File tree

10 files changed

+454
-367
lines changed

10 files changed

+454
-367
lines changed

app/code/Meta/Catalog/Controller/Adminhtml/Ajax/CategoryUpload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use Meta\BusinessExtension\Controller\Adminhtml\Ajax\AbstractAjax;
2626
use Meta\BusinessExtension\Helper\FBEHelper;
2727
use Meta\BusinessExtension\Model\System\Config as SystemConfig;
28-
use Meta\Catalog\Model\Feed\CategoryCollection;
28+
use Meta\Catalog\Model\Category\CategoryCollection;
2929

3030
class CategoryUpload extends AbstractAjax
3131
{

app/code/Meta/Catalog/Cron/CategorySyncCron.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
use Meta\BusinessExtension\Helper\FBEHelper;
2424
use Meta\BusinessExtension\Model\System\Config as SystemConfig;
25-
use Meta\Catalog\Model\Feed\CategoryCollection;
25+
use Meta\Catalog\Model\Category\CategoryCollection;
2626

2727
class CategorySyncCron
2828
{

app/code/Meta/Catalog/Helper/CatalogSyncHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
use Meta\BusinessExtension\Helper\FBEHelper;
2424
use Meta\BusinessExtension\Model\System\Config as SystemConfig;
25-
use Meta\Catalog\Model\Feed\CategoryCollection;
25+
use Meta\Catalog\Model\Category\CategoryCollection;
2626
use Meta\Catalog\Model\Product\Feed\Uploader;
2727

2828
class CatalogSyncHelper

app/code/Meta/Catalog/Helper/Product/Identifier.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,21 @@ public function __construct(SystemConfig $systemConfig, ProductRepository $produ
4949
$this->productRepository = $productRepository;
5050
}
5151

52+
/**
53+
* Get product's identifier col name(SKU or entity ID, depending on configuration)
54+
*
55+
* @return string
56+
*/
57+
public function getProductIdentifierColName(): string
58+
{
59+
if ($this->identifierAttr === IdentifierConfig::PRODUCT_IDENTIFIER_SKU) {
60+
return 'sku';
61+
} elseif ($this->identifierAttr === IdentifierConfig::PRODUCT_IDENTIFIER_ID) {
62+
return 'entity_id';
63+
}
64+
return '';
65+
}
66+
5267
/**
5368
* Get product's identifier (SKU or ID, depending on configuration)
5469
*

0 commit comments

Comments
 (0)