Пример #1
0
 /**
  * Create login
  *
  * @return Login
  */
 public function createLogin($email, $ip, $protocol)
 {
     $em = $this->getDoctrine()->getManager();
     $login = new Login();
     $login->setEmail($email);
     $login->setIp($ip);
     $login->setProtocol($protocol);
     $em->persist($login);
     $em->flush();
     return $login;
 }
Пример #2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $emailOrUsername = $input->getArgument('emailOrUsername');
     $ip = $input->getArgument('ip');
     $protocol = $input->getArgument('protocol');
     $user = $this->getContainer()->get('doctrine')->getRepository('rootiovmailmeBundle:User')->loadUserByUsername($emailOrUsername);
     if ($user) {
         $em = $this->getContainer()->get('doctrine')->getManager();
         $login = new Login();
         $login->setEmail($emailOrUsername);
         $login->setIp($ip);
         $login->setProtocol($protocol);
         $em->persist($login);
         $em->flush();
     }
 }