3 namespace Wallabag\CoreBundle\Command
;
5 use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand
;
6 use Symfony\Component\Console\Input\InputArgument
;
7 use Symfony\Component\Console\Output\OutputInterface
;
9 abstract class AbstractNotificationCommand
extends ContainerAwareCommand
11 /** @var OutputInterface */
14 protected function configure()
19 InputArgument
::OPTIONAL
,
20 'User to send the notification to'
26 * Fetches a user from its username.
28 * @param string $username
30 * @return \Wallabag\UserBundle\Entity\User
32 protected function getUser($username)
34 return $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($username);
37 protected function getDoctrine()
39 return $this->getContainer()->get('doctrine');