/** * 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()); } }