public function routeAction(Request $request) { $id = $request->getSession()->get('userId'); $user = new User(); $user->load($id); if (!$user->getPatientId()) { $user->transfer(); } return $this->redirectToRoute('patient_homepage', array('id' => $user->getPatientId())); }
public function saveRoleAction(Request $request) { $data = $request->request->all(); if ($request->getSession()->get('userId')) { $user = new User(); $user->load($data['user']); $user->setRoleId($data['role']); $user->save(); } return new Response(); }
public function fullLoad() { if ($this->getUserId()) { $user = new User(); $user->load($this->getUserId()); $this->setUserName($user->getName() . ' ' . $user->getSecondName()); } if ($this->getPatientId()) { $patient = new Patient(); $patient->load($this->getPatientId()); $this->setPatientName($patient->getName() . ' ' . $patient->getSecondName()); } if ($this->getDiseaseId()) { $disease = new Disease(); $disease->load($this->getDiseaseId()); $this->setTitle($disease->getTitle()); } }
public function fullLoad() { if ($this->getUserId()) { $user = new User(); $user->load($this->getUserId()); $this->setUserName($user->getName() . ' ' . $user->getSecondName()); } if ($this->getPatientId()) { $patient = new Patient(); $patient->load($this->getPatientId()); $this->setPatientName($patient->getName() . ' ' . $patient->getSecondName()); } if ($this->getServiceId()) { $service = new Service(); $service->load($this->getServiceId()); $this->setTitle($service->getTitle()); $this->setPrice($service->getPrice()); } }
/** * Send 'remind password' email. * * @param Request $request * @return \Symfony\Component\HttpFoundation\RedirectResponse */ public function remindAction(Request $request) { if (!$request->getSession()->has('userId')) { $data = $request->request->all(); $user = new User(); $user->load($data['email'], 'email'); if ($user->getId()) { $message = \Swift_Message::newInstance()->setSubject('Forget Password')->setFrom('*****@*****.**')->setTo($user->getEmail())->setBody($this->renderView('LancerLanceBundle:Emails:forgetpassword.html.twig', array('name' => $user->getName(), 'hash' => $user->getSecretHash())), 'text/html'); $this->get('mailer')->send($message); $request->getSession()->set('message', 'Email with instruction has been send.'); } } return $this->redirectToRoute('lance_authorization'); }