Example #1
0
 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.'));
         }
     }
 }
Example #2
0
 /**
  * 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);
 }
Example #3
0
 public function afterFind()
 {
     $this->certpasswd = $this->getCertPasswd();
     return parent::afterFind();
 }