-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReportImportCommand.php
More file actions
39 lines (33 loc) · 1.16 KB
/
ReportImportCommand.php
File metadata and controls
39 lines (33 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
namespace App\Command;
use App\Entity\Report;
use App\Service\ReportImporter;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class ReportImportCommand extends AbstractImportCommand
{
public function __construct(ReportImporter $reportImporter, EntityManagerInterface $entityManager)
{
parent::__construct($reportImporter, $entityManager);
}
protected function configure(): void
{
$this
->setName('itstyr:import:report')
->setDescription('Import reports from feed.')
->addArgument('src', InputArgument::REQUIRED, 'The src of the feed.')
->addOption('progress', 'p', InputOption::VALUE_NONE, 'The src of the feed.')
;
}
/**
* @throws \Exception
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->import(Report::class, $input->getArgument('src'), $output, $input->getOption('progress'));
return 0;
}
}