Example #1
0
 public function afterFind()
 {
     parent::afterFind();
     if (CMS::time() >= strtotime($this->date_end)) {
         $this->switch = 0;
         $this->save(false);
     }
 }
Example #2
0
 public function getDbConnection()
 {
     self::$master_db = Yii::app()->dbUser;
     if (self::$master_db instanceof DbConnection) {
         self::$master_db->setActive(true);
         return self::$master_db;
     } else {
         throw new CDbException(Yii::t('yii', 'Active Record requires a "db" DbConnection application component.'));
     }
 }
Example #3
0
 /**
  * Returns the static model of the specified AR class.
  * @return User the static model class
  */
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }