AnaestheticType::model PHP Метод

model() публичный статический Метод

Returns the static model of the specified AR class.
public static model ( $className = __CLASS__ ) : AnaestheticType
Результат AnaestheticType the static model class
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }

Usage Example

Пример #1
0
 /**
  * @param Element_OphTrOperationbooking_Operation $element
  * @param $action
  */
 protected function setElementDefaultOptions_Element_OphTrOperationbooking_Operation($element, $action)
 {
     if ($action == 'create') {
         // set the default eye
         if ($this->episode && $this->episode->diagnosis) {
             $element->eye_id = $this->episode->eye_id;
         }
         // set default anaesthetic based on whether patient is a child or not.
         $key = $this->patient->isChild() ? 'ophtroperationbooking_default_anaesthetic_child' : 'ophtroperationbooking_default_anaesthetic';
         if (isset(Yii::app()->params[$key])) {
             if ($at = AnaestheticType::model()->find('code=?', array(Yii::app()->params[$key]))) {
                 $element->anaesthetic_type_id = $at->id;
             }
         }
         if ($default_referral = $this->calculateDefaultReferral()) {
             $element->referral_id = $default_referral->id;
         }
         $element->site_id = Yii::app()->session['selected_site_id'];
     }
 }
All Usage Examples Of AnaestheticType::model