Example #1
0
 public function afterDelete()
 {
     UserServer::model()->deleteAllByAttributes(array('user_id' => $this->id));
     $ftpUser = FtpUser::model()->findByAttributes(array('name' => $this->name));
     if ($ftpUser) {
         FtpUserServer::model()->deleteAllByAttributes(array('user_id' => $ftpUser->id));
         $ftpUser->delete();
     }
     return parent::afterDelete();
 }
Example #2
0
 public function afterDelete()
 {
     ServerConfig::model()->deleteByPk($this->id);
     UserServer::model()->deleteAllByAttributes(array('server_id' => $this->id));
     FtpUserServer::model()->deleteAllByAttributes(array('server_id' => $this->id));
     Command::model()->deleteAllByAttributes(array('server_id' => $this->id));
     Schedule::model()->deleteAllByAttributes(array('server_id' => $this->id));
     $plrs = Player::model()->findAllByAttributes(array('server_id' => $this->id));
     foreach ($plrs as $plr) {
         $plr->delete();
     }
     return parent::afterDelete();
 }