Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Fixture.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Setup\Fixtures;
8 
9 use Symfony\Component\Console\Output\OutputInterface;
10 
14 abstract class Fixture
15 {
19  protected $priority;
20 
24  protected $fixtureModel;
25 
30  {
31  $this->fixtureModel = $fixtureModel;
32  }
33 
39  abstract public function execute();
40 
46  abstract public function getActionTitle();
47 
54  public function printInfo(OutputInterface $output)
55  {
56  foreach ($this->introduceParamLabels() as $configName => $label) {
57  $configValue = $this->fixtureModel->getValue($configName);
58  $generationCount = is_array($configValue) === true
59  ? count($configValue[array_keys($configValue)[0]])
60  : $configValue;
61 
62  if (!empty($generationCount)) {
63  $output->writeln('<info> |- ' . $label . ': ' . $generationCount . '</info>');
64  }
65  }
66  }
67 
73  abstract public function introduceParamLabels();
74 
80  public function getPriority()
81  {
82  return $this->priority;
83  }
84 }
__construct(FixtureModel $fixtureModel)
Definition: Fixture.php:29
printInfo(OutputInterface $output)
Definition: Fixture.php:54
$label
Definition: details.phtml:21