getRecordedComplications() публичный Метод

if no recorded complications are found and there are complication in the POST (user wants to save but the site redirect with form error) we get the complications from the POST and display so the user does not have to select it again
public getRecordedComplications ( integer $eye_id, integer $operation_note_id = null ) : array
$eye_id integer
$operation_note_id integer
Результат array
Пример #1
0
 public function actionGetPostOpComplicationList()
 {
     $element_id = \Yii::app()->request->getParam('element_id', null);
     $operation_note_id = \Yii::app()->request->getParam('operation_note_id', null);
     $eye_id = \Yii::app()->request->getParam('eye_id', null);
     if ($element_id) {
         $element = models\Element_OphCiExamination_PostOpComplications::model()->findByPk($element_id);
     } else {
         $element = new models\Element_OphCiExamination_PostOpComplications();
     }
     $right_complications = $element->getRecordedComplications(\Eye::RIGHT, $operation_note_id);
     $left_complications = $element->getRecordedComplications(\Eye::LEFT, $operation_note_id);
     $right_data = array();
     $left_data = array();
     foreach ($right_complications as $right_complication) {
         $right_data[] = array('id' => $right_complication['id'], 'name' => $right_complication['name']);
     }
     foreach ($left_complications as $left_complication) {
         $left_data[] = array('id' => $left_complication['id'], 'name' => $left_complication['name']);
     }
     $firm = \Firm::model()->findByPk(Yii::app()->session['selected_firm_id']);
     $subspecialty_id = $firm->serviceSubspecialtyAssignment ? $firm->serviceSubspecialtyAssignment->subspecialty_id : null;
     $right_select_values = models\OphCiExamination_PostOpComplications::model()->getPostOpComplicationsList($element_id, $operation_note_id, $subspecialty_id, \Eye::RIGHT);
     $right_select = array();
     foreach ($right_select_values as $right_select_value) {
         $right_select[] = array('id' => $right_select_value->id, 'name' => $right_select_value->name, 'display_order' => $right_select_value->display_order);
     }
     $left_select_values = models\OphCiExamination_PostOpComplications::model()->getPostOpComplicationsList($element_id, $operation_note_id, $subspecialty_id, \Eye::LEFT);
     foreach ($left_select_values as $left_select_value) {
         $left_select[] = array('id' => $left_select_value->id, 'name' => $left_select_value->name, 'display_order' => $left_select_value->display_order);
     }
     echo \CJSON::encode(array('right_values' => $right_data, 'left_values' => $left_data, 'right_select' => $right_select, 'left_select' => $left_select));
 }