Skip to content

Commit 753ec2f

Browse files
Andrei MaletsAndrei_Malets
authored andcommitted
MAGETWO-54708: bin/magento setup:performance:generate-fixtures fails if you have mysql auto_increment > 1
- Changed class and method naming
1 parent e7b5d14 commit 753ec2f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

setup/src/Magento/Setup/Model/FixtureGenerator/DbConfigurationHelper.php renamed to setup/src/Magento/Setup/Model/FixtureGenerator/AutoIncrement.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
namespace Magento\Setup\Model\FixtureGenerator;
88

99
/**
10-
* Class provides information about MySQL configuration settings.
10+
* Class provides information about MySQL auto_increment configuration setting.
1111
*/
12-
class DbConfigurationHelper
12+
class AutoIncrement
1313
{
1414
/**
1515
* @var \Magento\Framework\App\ResourceConnection
@@ -34,7 +34,7 @@ public function __construct(\Magento\Framework\App\ResourceConnection $resource)
3434
*
3535
* @return int
3636
*/
37-
public function getAutoIncrementIncrement()
37+
public function getIncrement()
3838
{
3939
if ($this->incrementValue === null) {
4040
$increment = $this->resource->getConnection()->fetchRow('SHOW VARIABLES LIKE "auto_increment_increment"');

setup/src/Magento/Setup/Model/FixtureGenerator/ConfigurableProductGenerator.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ class ConfigurableProductGenerator
2828
private $productGeneratorFactory;
2929

3030
/**
31-
* @var DbConfigurationHelper
31+
* @var AutoIncrement
3232
*/
33-
private $dbConfigurationHelper;
33+
private $autoIncrement;
3434

3535
/**
3636
* @param ProductGeneratorFactory $productGeneratorFactory
37-
* @param DbConfigurationHelper $dbConfigurationHelper
37+
* @param AutoIncrement $autoIncrement
3838
*/
3939
public function __construct(
4040
ProductGeneratorFactory $productGeneratorFactory,
41-
DbConfigurationHelper $dbConfigurationHelper
41+
AutoIncrement $autoIncrement
4242
) {
4343
$this->productGeneratorFactory = $productGeneratorFactory;
44-
$this->dbConfigurationHelper = $dbConfigurationHelper;
44+
$this->autoIncrement = $autoIncrement;
4545

4646
}
4747

@@ -112,7 +112,7 @@ public function generate($products, $fixtureMap)
112112
private function generateSuperAttributeId($superAttributeId, $entityNumber, array $fixture)
113113
{
114114
return $superAttributeId + ($entityNumber + 1) * $fixture['_attributes_count']
115-
* $this->dbConfigurationHelper->getAutoIncrementIncrement();
115+
* $this->autoIncrement->getIncrement();
116116
}
117117

118118
/**

0 commit comments

Comments
 (0)