Skip to content

Commit

Permalink
Merge pull request #70 from techdivision/pac-903
Browse files Browse the repository at this point in the history
PAC-903: add the enterprise variant
  • Loading branch information
kenza-ya authored Oct 11, 2024
2 parents 7f5cafb + e5d97d2 commit 33227fd
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Version 27.1.0

## Bugfixes

* None

## Features

* New validation added, whether the product of the website is assigned to the current shop view line
* `"import.callback.store.in.website.validator"`

# Version 27.0.1

## Bugfixes
Expand Down
43 changes: 43 additions & 0 deletions src/Observers/EeStoreWebsiteValidatorObserver.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

/**
* TechDivision\Import\Product\Ee\Observers\StoreWebsiteValidatorObserver
*
* PHP version 7
*
* @author MET <[email protected]>
* @copyright 2024 TechDivision GmbH <[email protected]>
* @license https://opensource.org/licenses/MIT
* @link https://github.com/techdivision/import
* @link http://www.techdivision.com
*/

namespace TechDivision\Import\Product\Ee\Observers;

use TechDivision\Import\Product\Msi\Utils\ColumnKeys;
use TechDivision\Import\Product\Observers\StoreWebsiteValidatorObserver;
use TechDivision\Import\Product\Utils\MemberNames;

/**
* Store view validator implementation.
*
* @author MET <[email protected]>
* @copyright 2024 TechDivision GmbH <[email protected]>
* @license https://opensource.org/licenses/MIT
* @link https://github.com/techdivision/import
* @link http://www.techdivision.com
*/
class EeStoreWebsiteValidatorObserver extends StoreWebsiteValidatorObserver
{
/**
* @return void
*/
public function setLastEntityRowId($sku): void
{
if (!$this->hasBeenProcessed($sku)) {
$this->entity = $this->loadProduct($sku);
$this->setLastEntityId($this->entity[MemberNames::ROW_ID]);
$this->lastEntityId = $this->getLastEntityId();
}
}
}
4 changes: 4 additions & 0 deletions symfony/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@
<argument type="service" id="import_product.utils.entity.type.code.mapping"/>
</service>

<service id="import_product_ee.store.in.website.validator.observer" class="TechDivision\Import\Product\Ee\Observers\EeStoreWebsiteValidatorObserver">
<argument type="service" id="import_product_ee.processor.product.bunch"/>
<argument type="service" id="import.processor.import"/>
</service>
</services>

</container>

0 comments on commit 33227fd

Please sign in to comment.