/**
  * {@inheritDoc}
  */
 public function removeReportingLead(\Vlreleases\UserBundle\Entity\User $reportingLeads)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'removeReportingLead', array($reportingLeads));
     return parent::removeReportingLead($reportingLeads);
 }
예제 #2
0
 /**
  * Sends email regarding registration status by admin to the corresponding user. 
  * 
  * @param \Symfony\Component\HttpFoundation\Request $resquest
  */
 public function emailApproveReject($toEmail, $action)
 {
     if ($action == "approve") {
         $userService = $this->get('UserService');
         $data = $userService->getData($toEmail);
         $em = $this->getDoctrine()->getManager();
         $role_entity = $em->getRepository('VlreleasesUserBundle:Role')->findOneBy(array("id" => '1'));
         $user = new User();
         $user->setUserName($data['0']->name);
         $user->setPassword($data['0']->password);
         $user->setEmpId($data['0']->empId);
         $user->setEmail($data['0']->email);
         $user->setStatus('1');
         $user->setRole($role_entity);
         $typeService = $this->getTypeService();
         $type = $typeService->getType(1);
         if ($type instanceof Type) {
             $user->setType($type);
         }
         $userId = $userService->save($user);
         if ($userId) {
             $message1 = "Your registration request for NITI has been accepted and You can login now";
         }
     } else {
         if ($action == "reject") {
             $message1 = "Your registration request for NITI was rejected.";
         }
     }
     $message = \Swift_Message::newInstance()->setSubject('NITI Registration Status')->setFrom('*****@*****.**')->setTo($toEmail)->setBody($message1)->setContentType("text/html");
     $this->get('mailer')->send($message);
 }