Пример #1
0
 /**
  * Pass through use_pas flag to allow pas supression
  * @see CActiveRecord::instantiate()
  */
 protected function instantiate($attributes)
 {
     $model = parent::instantiate($attributes);
     $model->use_pas = $this->use_pas;
     return $model;
 }
Пример #2
0
 /**
  * Override to allow us to have classes defined outside of core that store the data in a different way
  *
  * @param array $attributes
  * @return CActiveRecord
  */
 protected function instantiate($attributes)
 {
     if (isset($attributes['patient_measurement_id'])) {
         if ($pm = PatientMeasurement::model()->findByPk($attributes['patient_measurement_id'])) {
             $origin = $pm->originReference;
             if ($origin && $origin->event) {
                 $api = Yii::app()->moduleAPI->getForEventId($origin->event_id);
                 if ($api) {
                     OELog::log("we have an api");
                     return $api->getMeasurementClassForEventId($origin->event_id);
                 }
             }
         }
     }
     return parent::instantiate($attributes);
 }