CreateStatisticSnapshotCommand.php (809B)
1 <?php 2 3 namespace PartKeepr\StatisticBundle\Command; 4 5 use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; 6 use Symfony\Component\Console\Input\InputInterface; 7 use Symfony\Component\Console\Output\OutputInterface; 8 9 class CreateStatisticSnapshotCommand extends ContainerAwareCommand 10 { 11 public function configure() 12 { 13 parent::configure(); 14 $this->setName('partkeepr:cron:create-statistic-snapshot'); 15 $this->setDescription('Creates a statistic snapshot'); 16 } 17 18 public function execute(InputInterface $input, OutputInterface $output) 19 { 20 $this->getContainer()->get('partkeepr.statistic.service')->createStatisticSnapshot(); 21 $this->getContainer()->get('partkeepr.cronlogger_service')->markCronRun('partkeepr:cron:create-statistic-snapshot'); 22 } 23 }