예제 #1
0
 function getDbConnection()
 {
     if (self::$db !== null) {
         return self::$db;
     } else {
         self::$db = Yii::app()->getDb();
         if (self::$db instanceof CDbConnection) {
             return self::$db;
         } else {
             throw new CDbException(Yii::t('yii', 'Frontend Active Record requires a "frontendDb" CDbConnection application component.'));
         }
     }
 }
예제 #2
0
 /**
  * Returns the static model of the specified AR class.
  * @param string $className active record class name.
  * @return OrderHasFlightVoyage the static model class
  */
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }