/** * Runs the item import stack cronjob. * * @param Shopware_Components_Cron_CronJob $Job */ public function runItemImportStackUpdate(Shopware_Components_Cron_CronJob $Job) { $this->Config->setImportItemStackLastRunTimestamp(time()); $this->Config->setImportItemStackNextRunTimestamp(time() + $Job->getJob()->getInterval()); if (!$this->Status->maySynchronize()) { $this->Config->setImportItemStackStatus(0); return; } try { PlentymarketsImportStackItem::getInstance()->update(); $this->Config->setImportItemStackStatus(1); $this->Config->eraseImportItemStackError(); } catch (Exception $E) { $this->Config->setImportItemStackStatus(2); $this->Config->setImportItemStackError($E->getMessage()); } }