protected function execute()
 {
     $maxLogCount = Gpf_Settings::get(Gpf_Settings_Gpf::AUTO_DELETE_EVENTS_RECORDS_NUM);
     if ($maxLogCount > 0 && $this->getLogsCount() >= $maxLogCount) {
         $logs = Gpf_Db_Table_Logs::getInstance();
         $logs->truncate();
         $this->setDone();
         return;
     }
     if (Gpf_Settings::get(Gpf_Settings_Gpf::AUTO_DELETE_EVENTS) <= 0) {
         $this->setDone();
         return;
     }
     do {
         $this->checkInterruption();
         $statement = $this->deleteEvents();
     } while ($statement->affectedRows() > 0);
     $this->setDone();
 }
Exemplo n.º 2
0
 function init()
 {
     $this->setTable(Gpf_Db_Table_Logs::getInstance());
     parent::init();
 }