/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
setup/src/Magento/Setup/Fixtures/Fixture.php
84 строки
2 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 11:23
22 окт 2025, 11:23
6c2f6e6
Код
Авторство
О чём код?
<?php /** * Copyright 2015 Adobe * All Rights Reserved. */ namespace Magento\Setup\Fixtures; use Symfony\Component\Console\Output\OutputInterface; /** * @SuppressWarnings(PHPMD.NumberOfChildren) */ abstract class Fixture { /** * @var int */ protected $priority; /** * @var FixtureModel */ protected $fixtureModel; /** * @param FixtureModel $fixtureModel */ public function __construct(FixtureModel $fixtureModel) { $this->fixtureModel = $fixtureModel; } /** * Execute fixture * * @return void */ abstract public function execute(); /** * Get fixture action description * * @return string */ abstract public function getActionTitle(); /** * Print information about generated fixture. Print fixture label and amount of generated items * * @param OutputInterface $output * @return void */ public function printInfo(OutputInterface $output) { foreach ($this->introduceParamLabels() as $configName => $label) { $configValue = $this->fixtureModel->getValue($configName); $generationCount = is_array($configValue) === true ? count($configValue[array_keys($configValue)[0]]) : $configValue; if (!empty($generationCount)) { $output->writeln('<info> |- ' . $label . ': ' . $generationCount . '</info>'); } } } /** * Introduce parameters labels * * @return array */ abstract public function introduceParamLabels(); /** * Get fixture priority * * @return int */ public function getPriority() { return $this->priority; } }