OEModule\OphCiExamination\models\OphCiExamination_CataractSurgicalManagement_Eye::model PHP Method

model() public static method

Returns the static model of the specified AR class.
public static model ( $className = __CLASS__ ) : OphCiExamination_CataractSurgicalManagement_Eye
return OphCiExamination_CataractSurgicalManagement_Eye the static model class
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }

Usage Example

 public function setDefaultOptions()
 {
     if (in_array(Yii::app()->getController()->getAction()->id, array('created', 'ElementForm'))) {
         if ($api = Yii::app()->moduleAPI->get('OphTrOperationnote')) {
             if (!($patient = \Patient::model()->findByPk(@$_GET['patient_id']))) {
                 throw new Exception('Patient not found: ' . @$_GET['patient_id']);
             }
             if ($api->getOpnoteWithCataractElementInCurrentEpisode($patient)) {
                 $this->eye_id = OphCiExamination_CataractSurgicalManagement_Eye::model()->find('name=?', array('Second eye'))->id;
             } else {
                 $this->eye_id = OphCiExamination_CataractSurgicalManagement_Eye::model()->find('name=?', array('First eye'))->id;
             }
         }
     }
 }
All Usage Examples Of OEModule\OphCiExamination\models\OphCiExamination_CataractSurgicalManagement_Eye::model
OphCiExamination_CataractSurgicalManagement_Eye