Class SkuProcessor
@api
- Since
- 100.0.2
Definition at line 14 of file SkuProcessor.php.
◆ __construct()
__construct |
( |
\Magento\Catalog\Model\ProductFactory |
$productFactory | ) |
|
- Parameters
-
\Magento\Catalog\Model\ProductFactory | $productFactory | |
Definition at line 69 of file SkuProcessor.php.
◆ _getSkus()
Get skus data.
- Returns
- array
Definition at line 155 of file SkuProcessor.php.
158 $columns = [
'entity_id',
'type_id',
'attribute_set_id',
'sku'];
159 if ($this->getProductEntityLinkField() != $this->getProductIdentifierField()) {
160 $columns[] = $this->getProductEntityLinkField();
162 foreach ($this->productFactory->create()->getProductEntitiesInfo(
$columns) as
$info) {
163 $typeId =
$info[
'type_id'];
164 $sku = strtolower(
$info[
'sku']);
166 'type_id' => $typeId,
167 'attr_set_id' =>
$info[
'attribute_set_id'],
168 'entity_id' =>
$info[
'entity_id'],
169 'supported_type' => isset($this->productTypeModels[$typeId]),
170 $this->getProductEntityLinkField() =>
$info[$this->getProductEntityLinkField()],
foreach( $_productCollection as $_product)() ?>" class $info
◆ addNewSku()
addNewSku |
( |
|
$sku, |
|
|
|
$data |
|
) |
| |
- Parameters
-
- Returns
- $this
Definition at line 115 of file SkuProcessor.php.
117 $sku = strtolower($sku);
118 $this->newSkus[$sku] =
$data;
◆ getNewSku()
- Parameters
-
- Returns
- array|null
Definition at line 141 of file SkuProcessor.php.
144 $sku = strtolower($sku);
145 return $this->newSkus[$sku] ??
null;
◆ getOldSkus()
Get old skus array.
- Returns
- array
Definition at line 90 of file SkuProcessor.php.
92 if (!$this->oldSkus) {
◆ reloadOldSkus()
◆ setNewSkuData()
setNewSkuData |
( |
|
$sku, |
|
|
|
$key, |
|
|
|
$data |
|
) |
| |
- Parameters
-
string | $sku | |
string | $key | |
mixed | $data | |
- Returns
- $this
Definition at line 128 of file SkuProcessor.php.
130 $sku = strtolower($sku);
131 if (isset($this->newSkus[$sku])) {
132 $this->newSkus[$sku][$key] =
$data;
◆ setTypeModels()
setTypeModels |
( |
|
$typeModels | ) |
|
- Parameters
-
- Returns
- $this
Definition at line 79 of file SkuProcessor.php.
81 $this->productTypeModels = $typeModels;
◆ $newSkus
◆ $oldSkus
◆ $productFactory
◆ $productTypeModels
The documentation for this class was generated from the following file:
- vendor/magento/module-catalog-import-export/Model/Import/Product/SkuProcessor.php