예제 #1
0
 public function getDbConnection()
 {
     if (self::$dbvssea !== null) {
         return self::$dbvssea;
     } else {
         self::$dbvssea = Yii::app()->dbvssea;
         //Yii::app()->getDb("dbvssea");
         if (self::$dbvssea instanceof CDbConnection) {
             self::$dbname = self::$dbvssea->dbname;
             self::$dbserver = self::$dbvssea->dbserver;
             self::$dbvssea->setActive(true);
             return self::$dbvssea;
         } else {
             throw new CDbException(Yii::t('yii', 'Active Record requires a "dbvssea" 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 VSServidorCorreo the static model class
  */
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }