FamilyHistory::model PHP Метод

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

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

Usage Example

Пример #1
0
 public function addFamilyHistory($relative_id, $side_id, $condition_id, $comments)
 {
     if (!($fh = FamilyHistory::model()->find('patient_id=? and relative_id=? and side_id=? and condition_id=?', array($this->id, $relative_id, $side_id, $condition_id)))) {
         $fh = new FamilyHistory();
         $fh->patient_id = $this->id;
         $fh->relative_id = $relative_id;
         $fh->side_id = $side_id;
         $fh->condition_id = $condition_id;
     }
     $fh->comments = $comments;
     if (!$fh->save()) {
         throw new Exception("Unable to save family history: " . print_r($fh->getErrors(), true));
     }
 }
All Usage Examples Of FamilyHistory::model