/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
setup/src/Magento/Setup/Model/FixtureGenerator/AutoIncrement.php
45 строк
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 11:23
22 окт 2025, 11:23
6c2f6e6
Код
Авторство
О чём код?
<?php /** * Copyright 2017 Adobe * All Rights Reserved. */ namespace Magento\Setup\Model\FixtureGenerator; /** * Class provides information about MySQL auto_increment configuration setting. */ class AutoIncrement { /** * @var \Magento\Framework\App\ResourceConnection */ private $resource; /** * @var int */ private $incrementValue; /** * @param \Magento\Framework\App\ResourceConnection $resource */ public function __construct(\Magento\Framework\App\ResourceConnection $resource) { $this->resource = $resource; } /** * Get value of auto_increment_increment variable. * * @return int */ public function getIncrement() { if ($this->incrementValue === null) { $increment = $this->resource->getConnection()->fetchRow('SHOW VARIABLES LIKE "auto_increment_increment"'); $this->incrementValue = !empty($increment['Value']) ? (int)$increment['Value'] : 1; } return $this->incrementValue; } }