/** * This function updates the cron job times. Through this the cron job will always be active * * @param \Shopware_Components_Cron_CronJob $job * @return void */ protected function prepareCronJob($job) { echo '<br>'; $end = new \Zend_Date($job->get('end')); $start = new \Zend_Date($job->get('start')); $next = new \Zend_Date($job->get('next')); $sql = "UPDATE s_crontab\n\t\t\t SET `end` = ?, `start` = ?, `next` = ?\n\t\t\t WHERE id = ?"; $this->db->executeUpdate($sql, array($end, $start, $next, $job->get('id'))); }
/** * This function updates the cron job times. Through this the cron job will always be active * @param Shopware_Components_Cron_CronJob $job * @return void */ protected function prepareCronJob($job) { set_time_limit(1000); echo '<br>'; $end = new Zend_Date($job->get("end")); $start = new Zend_Date($job->get("start")); $next = new Zend_Date($job->get("next")); $sql= "UPDATE s_crontab SET `end` = ?, `start` = ?, `next` = ? WHERE id = ?"; Shopware()->Db()->query($sql, array($end, $start, $next, $job->get("id"))); }
/** * Runs the item bundle import cronjob. * * @param Shopware_Components_Cron_CronJob $Job */ public function runItemBundleImport(Shopware_Components_Cron_CronJob $Job) { $this->Config->setImportItemBundleLastRunTimestamp(time()); $this->Config->setImportItemBundleNextRunTimestamp(time() + $Job->getJob()->getInterval()); if (!$this->Status->maySynchronize()) { $this->Config->setImportItemBundleStatus(0); return; } try { $a = new PlentymarketsImportControllerItemBundle(); $a->import(); $this->Config->setImportItemBundleStatus(1); $this->Config->eraseImportItemBundleError(); } catch (Exception $E) { $this->Config->setImportItemBundleStatus(2); $this->Config->setImportItemBundleError($E->getMessage()); } }