<?php
declare(strict_types=1);
namespace Hitso\Bundle\CommonBundle\Doctrine\DataFixtures;
use Doctrine\Common\DataFixtures\AbstractFixture as BaseAbstractFixture;
use Doctrine\Persistence\ObjectManager;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\Console\Event\ConsoleCommandEvent;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* Class AbstractFixture
*
* @package Hitso\Bundle\CommonBundle\Doctrine\DataFixtures
*/
class AbstractFixture extends BaseAbstractFixture implements EventSubscriberInterface
{
/**
* @var OutputInterface
*/
protected $output;
/**
* @var Command
*/
protected $command;
/**
* @return array|string[]
*/
public static function getSubscribedEvents()
{
return [
ConsoleEvents::COMMAND => 'init',
];
}
/**
* @param ConsoleCommandEvent $event
*/
public function init(ConsoleCommandEvent $event): void
{
$this->output = $event->getOutput();
$this->command = $event->getCommand();
}
/**
* @param ObjectManager $manager
*/
public function load(ObjectManager $manager): void
{
}
}