Пример #1
0
 public function getDbConnection()
 {
     if (self::$dbvsseaint !== null) {
         return self::$dbvsseaint;
     } else {
         self::$dbvsseaint = Yii::app()->dbvsseaint;
         //Yii::app()->getDb("dbvssea");
         if (self::$dbvsseaint instanceof CDbConnection) {
             self::$dbname = self::$dbvsseaint->dbname;
             self::$dbserver = self::$dbvsseaint->dbserver;
             self::$dbvsseaint->setActive(true);
             return self::$dbvsseaint;
         } else {
             throw new CDbException(Yii::t('yii', 'Active Record requires a "dbvsseaint" CDbConnection application component.'));
         }
     }
 }
Пример #2
0
 /**
  * Returns the static model of the specified AR class.
  * Please note that you should have this exact method in all your CActiveRecord descendants!
  * @param string $className active record class name.
  * @return NubeFactura the static model class
  */
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }