public function preExecute()
 {
     parent::preExecute();
     $this->institutionService = $this->get('services.institution');
     // Check Institution
     if (!$this->institution) {
         throw $this->createNotFoundException('Invalid Institution');
     }
     $this->request = $this->getRequest();
 }
 public function preExecute()
 {
     $this->signUpService = $this->get('services.institution_signup');
     $this->institutionService = $this->get('services.institution');
     $this->request = $this->getRequest();
     if ($imcId = $this->getRequest()->get('imcId', 0)) {
         $this->institutionMedicalCenter = $this->get('services.institution_medical_center')->findById($imcId, false);
     }
     parent::preExecute();
 }
 public function preExecute()
 {
     parent::preExecute();
     $this->request = $this->getRequest();
     $this->imcService = $this->get('services.institution_medical_center');
     $this->institutionMedicalCenter = $this->imcService->findById($this->request->get('imcId', 0));
     if (!$this->institutionMedicalCenter) {
         throw $this->createNotFoundException('Invalid medical center');
     }
 }
コード例 #4
0
 public function preExecute()
 {
     parent::preExecute();
     $this->repository = $this->getDoctrine()->getRepository('InstitutionBundle:InstitutionMedicalCenter');
     if ($idId = $this->getRequest()->get('idId', 0)) {
         $this->institutionDoctor = $this->getDoctrine()->getRepository('DoctorBundle:Doctor')->find($idId);
     }
     if ($imcId = $this->getRequest()->get('imcId', 0)) {
         $this->institutionMedicalCenter = $this->repository->find($imcId);
     }
 }
コード例 #5
0
 public function preExecute()
 {
     parent::preExecute();
     $isId = $this->getRequest()->get('isId', 0);
     if ($isId) {
         $this->institutionSpecialization = $this->getDoctrine()->getRepository('InstitutionBundle:InstitutionSpecialization')->find($isId);
         if (!$this->institutionSpecialization) {
             throw $this->createNotFoundException("Invalid institution specialization");
         }
     }
 }
 public function preExecute()
 {
     parent::preExecute();
     $this->repository = $this->getDoctrine()->getRepository('InstitutionBundle:InstitutionMedicalCenter');
     $this->institutionService = $this->get('services.institution');
     $this->request = $this->getRequest();
     // NOTE: This code is not necessary anymore and can be remove.
     if ($imcId = $this->getRequest()->get('imcId', 0)) {
         $this->institutionMedicalCenter = $this->repository->find($imcId);
     }
     // End of note
     if ($this->isSingleCenter) {
         $this->institutionMedicalCenter = $this->institutionService->getFirstMedicalCenter($this->institution);
     }
 }
コード例 #7
0
 public function preExecute()
 {
     parent::preExecute();
     if ($imcId = $this->getRequest()->get('imcId', 0)) {
         $this->institutionMedicalCenter = $this->getDoctrine()->getRepository('InstitutionBundle:InstitutionMedicalCenter')->find($imcId);
         // non-existent medical center group
         if (!$this->institutionMedicalCenter) {
             throw $this->createNotFoundException('Invalid medical center.');
         }
         // medical center group does not belong to this institution
         if ($this->institutionMedicalCenter->getInstitution()->getId() != $this->institution->getId()) {
             return new Response('Medical center does not belong to institution', 401);
         }
     }
     if ($isId = $this->getRequest()->get('isId', 0)) {
         $this->institutionSpecialization = $this->getDoctrine()->getRepository('InstitutionBundle:InstitutionSpecialization')->find($isId);
     }
 }
コード例 #8
0
 public function preExecute()
 {
     parent::preExecute();
     $this->repository = $this->getDoctrine()->getRepository('InstitutionBundle:InstitutionMedicalCenter');
     $this->service = $this->get('services.institution_medical_center');
     // Temporary condition for eagerLoad
     if ($imcId = $this->getRequest()->get('imcId', 0)) {
         if ($this->getRequest()->attributes->get('_route') == 'institution_medicalCenter_view') {
             $this->institutionMedicalCenter = $this->service->findById($imcId, array('logo' => 'a.logo', 'contactDetails' => 'a.contactDetails', 'businessHours' => 'a.businessHours', 'specializations' => 'a.institutionSpecializations'));
             if ($this->institutionMedicalCenter->getInstitution()->getId() != $this->institution->getId()) {
                 return $this->_redirectIndexWithFlashMessage('Invalid medical center.', 'error');
             }
         } else {
             $this->institutionMedicalCenter = $this->repository->find($imcId);
         }
         if (!$this->institutionMedicalCenter) {
             if ($this->getRequest()->isXmlHttpRequest()) {
                 throw $this->createNotFoundException('Invalid medical center.');
             } else {
                 return $this->_redirectIndexWithFlashMessage('Invalid medical center.', 'error');
             }
         }
     }
 }
コード例 #9
0
 public function preExecute()
 {
     parent::preExecute();
     $this->inquiryRepo = $this->getDoctrine()->getRepository('InstitutionBundle:InstitutionInquiry');
 }
コード例 #10
0
 public function preExecute()
 {
     parent::preExecute();
 }