SyncTipsCommand.php (759B)
1 <?php 2 3 namespace PartKeepr\TipOfTheDayBundle\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 SyncTipsCommand extends ContainerAwareCommand 10 { 11 protected function configure() 12 { 13 $this 14 ->setName('partkeepr:cron:synctips') 15 ->setDescription('Syncronizes the tips from the PartKeepr website'); 16 } 17 18 protected function execute(InputInterface $input, OutputInterface $output) 19 { 20 $this->getContainer()->get('partkeepr.tip_of_the_day_service')->syncTips(); 21 $this->getContainer()->get('partkeepr.cronlogger_service')->markCronRun('partkeepr:cron:synctips'); 22 } 23 }