/** * Runs the item import cronjob. * * @param Shopware_Components_Cron_CronJob $Job */ public function runItemImport(Shopware_Components_Cron_CronJob $Job) { $this->Config->setImportItemLastRunTimestamp(time()); $this->Config->setImportItemNextRunTimestamp(time() + $Job->getJob()->getInterval()); if (!$this->Status->maySynchronize()) { $this->Config->setImportItemStatus(0); return; } try { PlentymarketsImportController::importItems(); $this->Config->setImportItemStatus(1); $this->Config->eraseImportItemError(); } catch (Exception $E) { $this->Config->setImportItemStatus(2); $this->Config->setImportItemError($E->getMessage()); } }