BaseEventTypeController::initActionCreate PHP Method

initActionCreate() protected method

Initialise the controller prior to a create action.
protected initActionCreate ( )
    protected function initActionCreate()
    {
        $this->moduleStateCssClass = 'edit';
        $this->setPatient($_REQUEST['patient_id']);
        if (!($this->episode = $this->getEpisode())) {
            $this->redirectToPatientEpisodes();
        }
        // we instantiate an event object for use with validation rules that are dependent
        // on episode and patient status
        $this->event = new Event();
        $this->event->episode_id = $this->episode->id;
        $this->event->event_type_id = $this->event_type->id;
    }

Usage Example

Esempio n. 1
0
 /**
  * Call edit init and set attribute for alerting which side the latest injection management
  * implies should be injected.
  *
  * @see BaseEventTypeController::createInit()
  */
 protected function initActionCreate()
 {
     parent::initActionCreate();
     $this->editInit();
     // set up the injection side if provided by the injection management in examination
     $exam_api = Yii::app()->moduleAPI->get('OphCiExamination');
     // We only want to show the injection mananagement side highlighting from injection management that has
     // been created on the day of this injection
     $since = new DateTime();
     $since->setTime(0, 0, 0);
     if ($this->episode && $exam_api && ($imc = $exam_api->getLatestInjectionManagementComplex($this->episode, $since))) {
         if ($side = $imc->getInjectionSide()) {
             $this->side_to_inject = $side;
         } else {
             $this->side_to_inject = 0;
         }
     }
 }
All Usage Examples Of BaseEventTypeController::initActionCreate
BaseEventTypeController