本文整理汇总了PHP中BaseActiveRecordVersioned::instantiate方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseActiveRecordVersioned::instantiate方法的具体用法?PHP BaseActiveRecordVersioned::instantiate怎么用?PHP BaseActiveRecordVersioned::instantiate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseActiveRecordVersioned
的用法示例。
在下文中一共展示了BaseActiveRecordVersioned::instantiate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: instantiate
/**
* 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: instantiate
/**
* 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);
}