예제 #1
0
 public function uninstall()
 {
     parent::uninstall();
     $cron = \GO\Base\Cron\CronJob::model()->findSingleByAttribute('job', 'GO\\Dropbox\\Cron\\Sync');
     if (!$cron) {
         // No cronjob found, so nothing needs to be deleted.
         return true;
     }
     if (!$cron->delete()) {
         // Try to delete the cronjob, if it's not possible then throw an exception.
         throw new \Exception('The Dropbox systemtask could not be deleted automatically. Please try to delete it manually in the "System tasks module."');
     } else {
         return true;
     }
 }