Ejemplo n.º 1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $name = $input->getArgument('name');
     $episode = $input->getArgument('episode');
     $show = Show::create($name, $episode);
     $this->repo->save($show);
 }
Ejemplo n.º 2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $shows = $this->repo->findAll();
     foreach ($shows as $show) {
         /** @var Show $show */
         $output->writeln((string) $show . ' ' . $show->getLastEpisode());
     }
 }
Ejemplo n.º 3
0
 /**
  * @param bool|false $recurse
  */
 public function check($recurse = false)
 {
     $this->output->writeln("Looking for new episodes...");
     $shows = $this->showRepo->findAll();
     if (!$shows) {
         $this->output->writeln("No shows found");
     }
     foreach ($shows as $show) {
         /** @var Show $show */
         try {
             $nextEpisode = $show->getLastEpisode()->nextEpisode();
             if ($this->tryEpisode($show, $nextEpisode, $recurse)) {
                 continue;
             }
             $nextSeason = $show->getLastEpisode()->firstEpisodeNextSeason();
             $this->tryEpisode($show, $nextSeason, $recurse);
         } catch (\Exception $e) {
             $this->output->writeln("Error checking {$show}: " . $e->getMessage());
         }
     }
     $this->output->writeln("Done looking for new episodes.");
 }