protected static function getMainDbConnection() { if (self::$dbMain !== null) { return self::$dbMain; } else { self::$dbMain = Yii::app()->dbMain; if (self::$dbMain instanceof CDbConnection) { self::$dbMain->setActive(true); return self::$dbMain; } else { throw new CDbException(Yii::t('yii', 'Active Record requires a "db" CDbConnection application component.')); } } }
/** * Returns the static model of the specified AR class. * @param string $className active record class name. * @return Currecies the static model class */ public static function model($className = __CLASS__) { return parent::model($className); }
public function afterFind() { $this->certpasswd = $this->getCertPasswd(); return parent::afterFind(); }