-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1375 from magento-mpi/pr-regression-ece
[MPI] Bugfixes
- Loading branch information
Showing
27 changed files
with
362 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\SalesSequence\Setup; | ||
|
||
use Magento\Framework\Setup\InstallDataInterface; | ||
use Magento\Framework\Setup\ModuleContextInterface; | ||
use Magento\Framework\Setup\ModuleDataSetupInterface; | ||
|
||
/** | ||
* Recurring data upgrade for SalesSequence module. | ||
*/ | ||
class RecurringData implements InstallDataInterface | ||
{ | ||
/** | ||
* @var SequenceCreator | ||
*/ | ||
private $sequenceCreator; | ||
|
||
/** | ||
* @param SequenceCreator $sequenceCreator | ||
*/ | ||
public function __construct( | ||
SequenceCreator $sequenceCreator | ||
) { | ||
$this->sequenceCreator = $sequenceCreator; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) | ||
{ | ||
$this->sequenceCreator->create(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\SalesSequence\Setup; | ||
|
||
use Magento\SalesSequence\Model\Builder; | ||
use Magento\SalesSequence\Model\Config as SequenceConfig; | ||
use Magento\SalesSequence\Model\EntityPool; | ||
|
||
/** | ||
* Initial creating sequences. | ||
*/ | ||
class SequenceCreator | ||
{ | ||
/** | ||
* Sales setup factory | ||
* | ||
* @var EntityPool | ||
*/ | ||
private $entityPool; | ||
|
||
/** | ||
* @var Builder | ||
*/ | ||
private $sequenceBuilder; | ||
|
||
/** | ||
* @var SequenceConfig | ||
*/ | ||
private $sequenceConfig; | ||
|
||
/** | ||
* @param EntityPool $entityPool | ||
* @param Builder $sequenceBuilder | ||
* @param SequenceConfig $sequenceConfig | ||
*/ | ||
public function __construct( | ||
EntityPool $entityPool, | ||
Builder $sequenceBuilder, | ||
SequenceConfig $sequenceConfig | ||
) { | ||
$this->entityPool = $entityPool; | ||
$this->sequenceBuilder = $sequenceBuilder; | ||
$this->sequenceConfig = $sequenceConfig; | ||
} | ||
|
||
/** | ||
* Creates sales sequences. | ||
*/ | ||
public function create() | ||
{ | ||
$defaultStoreIds = [0, 1]; | ||
foreach ($defaultStoreIds as $storeId) { | ||
foreach ($this->entityPool->getEntities() as $entityType) { | ||
$this->sequenceBuilder->setPrefix($this->sequenceConfig->get('prefix')) | ||
->setSuffix($this->sequenceConfig->get('suffix')) | ||
->setStartValue($this->sequenceConfig->get('startValue')) | ||
->setStoreId($storeId) | ||
->setStep($this->sequenceConfig->get('step')) | ||
->setWarningValue($this->sequenceConfig->get('warningValue')) | ||
->setMaxValue($this->sequenceConfig->get('maxValue')) | ||
->setEntityType($entityType)->create(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.