DrugSetItem::model PHP Method

model() public static method

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

Usage Example

コード例 #1
0
 /**
  * Ajax function to get drug set for admin page (we do not have patient_id there), and we also load the
  * name and subspecialty here.
  *
  * @param $key
  * @param $set_id
  *
  * @throws CException
  */
 public function actionSetFormAdmin($key, $set_id)
 {
     $drugset = DrugSet::model()->findByPk($set_id);
     $returnData = array();
     $returnData['drugsetName'] = $drugset->name;
     $returnData['drugsetSubspecialtyId'] = $drugset->subspecialty_id;
     $returnData['tableRows'] = '';
     // the HTML content for the prescription items table
     $key = (int) $key;
     $drug_set_items = DrugSetItem::model()->findAllByAttributes(array('drug_set_id' => $set_id));
     foreach ($drug_set_items as $drug_set_item) {
         $returnData['tableRows'] .= $this->renderPrescriptionItem($key, $drug_set_item);
         ++$key;
     }
     echo json_encode($returnData);
 }
All Usage Examples Of DrugSetItem::model