@param \Spryker\Zed\DataImport\Business\Model\DataSet\DataSetInterface $dataSet

@return void
332600
public function execute(DataSetInterface $dataSet): void
    {
        if (!$dataSet[ProductAlternativeDataSetInterface::KEY_COLUMN_ALTERNATIVE_PRODUCT_ABSTRACT_SKU]) {
            return;
        }

        $this->addAlternativeProductAbstractId($dataSet);
    }
8213
public function execute(DataSetInterface $dataSet): void
    {
        $merchantRelationshipKey = $dataSet[MerchantRelationshipProductListDataSetInterface::MERCHANT_RELATION_KEY];
        if (!$merchantRelationshipKey) {
            throw new InvalidDataException(sprintf('"%s" is required.', MerchantRelationshipProductListDataSetInterface::MERCHANT_RELATION_KEY));
        }

        if (!isset($this->idMerchantRelationshipCache[$merchantRelationshipKey])) {
            /** @var \Orm\Zed\MerchantRelationship\Persistence\SpyMerchantRelationshipQuery $merchantRelationshipQuery */
            $merchantRelationshipQuery = SpyMerchantRelationshipQuery::create()->select(SpyMerchantRelationshipTableMap::COL_ID_MERCHANT_RELATIONSHIP);
            /** @var int|null $idMerchantRelationship */
            $idMerchantRelationship = $merchantRelationshipQuery->findOneByMerchantRelationshipKey($merchantRelationshipKey);

            if (!$idMerchantRelationship) {
                throw new EntityNotFoundException(sprintf('Could not find Merchant Relationship by key "%s"', $merchantRelationshipKey));
            }
            $this->idMerchantRelationshipCache[$merchantRelationshipKey] = $idMerchantRelationship;
        }
        $dataSet[MerchantRelationshipProductListDataSetInterface::ID_MERCHANT_RELATIONSHIP] = $this->idMerchantRelationshipCache[$merchantRelationshipKey];
    }
940131
protected function checkIfProductHasConcreteOrAbstractAlternative(DataSetInterface $dataSet): void
    {
        if (!$dataSet[ProductAlternativeDataSetInterface::KEY_COLUMN_ALTERNATIVE_PRODUCT_CONCRETE_SKU] &&
            !$dataSet[ProductAlternativeDataSetInterface::KEY_COLUMN_ALTERNATIVE_PRODUCT_ABSTRACT_SKU]
        ) {
            throw new InvalidDataException(
                sprintf(
                    'Product concrete with SKU "%s" has neither concrete nor abstract alternative products',
                    $dataSet[ProductAlternativeDataSetInterface::KEY_COLUMN_CONCRETE_SKU]
                )
            );
        }
    }
1026433
public function execute(DataSetInterface $dataSet): void
    {
        $shoppingListCompanyUserEntity = $this->createShoppingListCompanyUserQuery()
            ->filterByFkShoppingList($dataSet[ShoppingListCompanyUserDataSetInterface::ID_SHOPPING_LIST])
            ->filterByFkCompanyUser($dataSet[ShoppingListCompanyUserDataSetInterface::ID_COMPANY_USER])
            ->findOneOrCreate();

        $shoppingListCompanyUserEntity
            ->setFkShoppingListPermissionGroup($dataSet[ShoppingListCompanyUserDataSetInterface::ID_PERMISSION_GROUP])
            ->save();
    }
755694
public function train(Dataset $dataset) : void
    {
        $this->samples = $this->kdistances = $this->lrds = [];

        $this->partial($dataset);
    }
487786
public function train(Dataset $dataset) : void
    {
        if (!$dataset instanceof Labeled) {
            throw new InvalidArgumentException('This estimator requires a'
                . ' labeled training set.');
        }

        $this->strategy->fit($dataset->labels());

        $this->trained = true;
    }
860328
public function execute(DataSetInterface $dataSet): void
    {
        $idCompany = $this->getIdCompanyByKey($dataSet[CompanyRoleDataSetInterface::COLUMN_COMPANY_KEY]);

        $companyRoleEntity = SpyCompanyRoleQuery::create()
            ->filterByKey($dataSet[CompanyRoleDataSetInterface::COLUMN_COMPANY_ROLE_KEY])
            ->findOneOrCreate();

        $companyRoleEntity
            ->setFkCompany($idCompany)
            ->setName($dataSet[CompanyRoleDataSetInterface::COLUMN_COMPANY_ROLE_NAME])
            ->setIsDefault((bool)$dataSet[CompanyRoleDataSetInterface::COLUMN_IS_DEFAULT])
            ->save();
    }
394850
public function execute(DataSetInterface $dataSet): void
    {
        $dataSet[PriceProductMerchantRelationshipDataSetInterface::ID_PRICE_PRODUCT_STORE] = $this->getIdPriceProductStoreEntity($dataSet);
    }
442274
protected function getIso3Code(DataSetInterface $dataSet)
    {
        if (isset($dataSet[CompanyUnitAddressDataSet::COUNTRY_ISO_3_CODE]) && !empty($dataSet[CompanyUnitAddressDataSet::COUNTRY_ISO_3_CODE])) {
            return $dataSet[CompanyUnitAddressDataSet::COUNTRY_ISO_3_CODE];
        }

        return null;
    }
51219
public function execute(DataSetInterface $dataSet)
    {
        $categoryEntity = $this->findOrCreateCategory($dataSet);
        $this->findOrCreateAttributes($categoryEntity, $dataSet);
        $categoryNodeEntity = $this->findOrCreateNode($categoryEntity, $dataSet);

        $this->categoryReader->addCategory($categoryEntity, $categoryNodeEntity);
    }
1311559
public function execute(DataSetInterface $dataSet): void
    {
        $productSku = $dataSet[ProductAlternativeDataSetInterface::KEY_COLUMN_CONCRETE_SKU];

        if (!isset($this->idProductCache[$productSku])) {
            $productEntity = SpyProductQuery::create()->findOneBySku($productSku);
            if (!$productEntity) {
                throw new EntityNotFoundException(sprintf('Could not find product by sku "%s"', $productSku));
            }

            $this->idProductCache[$productSku] = $productEntity->getIdProduct();
        }

        $dataSet[ProductAlternativeDataSetInterface::FK_PRODUCT] = $this->idProductCache[$productSku];
    }
475157
public function execute(DataSetInterface $dataSet): void
    {
        $idCompanyRole = $this->getIdCompanyRoleByKey($dataSet[CompanyUserRoleDataSetInterface::COLUMN_COMPANY_ROLE_KEY]);
        $idCompanyUser = $this->getIdCompanyUserByKey($dataSet[CompanyUserRoleDataSetInterface::COLUMN_COMPANY_USER_KEY]);

        $companyUserRoleEntity = SpyCompanyRoleToCompanyUserQuery::create()
            ->filterByFkCompanyRole($idCompanyRole)
            ->filterByFkCompanyUser($idCompanyUser)
            ->findOneOrCreate();

        $companyUserRoleEntity->save();
    }
1199052
public function execute(DataSetInterface $dataSet): void
    {
        $productConcreteSku = $dataSet[PriceProductDataSet::KEY_CONCRETE_SKU];
        if (empty($productConcreteSku)) {
            return;
        }

        if (!isset($this->idProductCache[$productConcreteSku])) {
            $productQuery = new SpyProductQuery();
            $idProduct = $productQuery
                ->select(SpyProductTableMap::COL_ID_PRODUCT)
                ->findOneBySku($productConcreteSku);

            if (!$idProduct) {
                throw new EntityNotFoundException(sprintf('Could not find product by sku "%s"', $productConcreteSku));
            }

            $this->idProductCache[$productConcreteSku] = $idProduct;
        }

        $dataSet[PriceProductDataSet::ID_PRODUCT_CONCRETE] = $this->idProductCache[$productConcreteSku];
    }
174041
public function execute(DataSetInterface $dataSet)
    {
        $companyKey = $dataSet[CompanyUnitAddressDataSet::COMPANY_KEY];
        if (!isset($this->idCompanyCache[$companyKey])) {
            $companyQuery = new SpyCompanyQuery();
            $idCompany = $companyQuery
                ->select(SpyCompanyTableMap::COL_ID_COMPANY)
                ->findOneByKey($companyKey);

            if (!$idCompany) {
                throw new EntityNotFoundException(sprintf('Could not find company by key "%s"', $companyKey));
            }

            $this->idCompanyCache[$companyKey] = $idCompany;
        }

        $dataSet[CompanyUnitAddressDataSet::ID_COMPANY] = $this->idCompanyCache[$companyKey];
    }
954477
protected function addAlternativeProductAbstractId(DataSetInterface $dataSet): void
    {
        $productAlternativeSku = $dataSet[ProductAlternativeDataSetInterface::KEY_COLUMN_ALTERNATIVE_PRODUCT_ABSTRACT_SKU];

        if (!isset($this->idProductAbstractCache[$productAlternativeSku])) {
            /** @var \Orm\Zed\Product\Persistence\SpyProductAbstract|null $productAbstractEntity */
            $productAbstractEntity = SpyProductAbstractQuery::create()->findOneBySku($productAlternativeSku);
            if (!$productAbstractEntity) {
                throw new EntityNotFoundException(
                    sprintf(
                        'Could not find product by sku "%s"',
                        $productAlternativeSku
                    )
                );
            }

            $this->idProductAbstractCache[$productAlternativeSku] = $productAbstractEntity->getIdProductAbstract();
        }
        $dataSet[ProductAlternativeDataSetInterface::FK_PRODUCT_ABSTRACT_ALTERNATIVE] = $this->idProductAbstractCache[$productAlternativeSku];
    }
1299570
protected function validateDataSet(DataSetInterface $dataSet): void
    {
        if (!$dataSet[MerchantDataSetInterface::MERCHANT_KEY]) {
            throw new InvalidDataException('"' . MerchantDataSetInterface::MERCHANT_KEY . '" is required.');
        }

        if (!$dataSet[MerchantDataSetInterface::NAME]) {
            throw new InvalidDataException('"' . MerchantDataSetInterface::NAME . '" is required.');
        }
    }
141583
public function execute(DataSetInterface $dataSet): void
    {
        if (!$dataSet[MerchantRelationshipDataSetInterface::COMPANY_BUSINESS_UNIT_ASSIGNEE_KEYS]) {
            $dataSet[MerchantRelationshipDataSetInterface::ID_COMPANY_BUSINESS_UNIT_ASSIGNEE_COLLECTION] = [];

            return;
        }

        $companyBusinessUnitKeys = explode(
            $this->getAssigneeDelimiter(),
            $dataSet[MerchantRelationshipDataSetInterface::COMPANY_BUSINESS_UNIT_ASSIGNEE_KEYS]
        );

        $companyBusinessUnitAssignee = [];
        foreach ($companyBusinessUnitKeys as $companyBusinessUnitKey) {
            $companyBusinessUnitAssignee[] = $this->findIdCompanyBusinessUnit($companyBusinessUnitKey);
        }

        $dataSet[MerchantRelationshipDataSetInterface::ID_COMPANY_BUSINESS_UNIT_ASSIGNEE_COLLECTION] = $companyBusinessUnitAssignee;
    }