Example #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->table->setHeaders(['id', 'Title', 'Description']);
     foreach ($this->repository->getAll() as $exercise) {
         $this->table->addRow([$exercise->getId(), $exercise->getTitle(), $exercise->getDescription()]);
     }
     $this->table->render();
 }
Example #2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     try {
         $this->repository->add($input->getArgument('title'), $input->getArgument('description'));
     } catch (Exception $e) {
         $output->writeln('Something went wrong');
     }
 }