Procedure::model PHP Method

model() public static method

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

Usage Example

 public function actionComplications($id)
 {
     if (!Procedure::model()->findByPk($id)) {
         throw new Exception("Unknown procedure: {$id}");
     }
     $complications = array();
     foreach (Yii::app()->db->createCommand()->select("b.name")->from("complication b")->join("procedure_complication pb", "pb.complication_id = b.id")->where("pb.proc_id = {$id} and b.active = 1")->order("b.name asc")->queryAll() as $row) {
         $complications[] = $row['name'];
     }
     echo json_encode($complications);
 }
All Usage Examples Of Procedure::model