/** * If an instance of PlentymarketsExportContinuousController exists, it returns this instance. * Else it creates a new instance of PlentymarketsExportController. * * @return PlentymarketsExportContinuousController */ public static function getInstance() { if (!self::$Instance instanceof self) { self::$Instance = new self(); } return self::$Instance; }
/** * Runs the order incoming item export cronjob. * * @param Shopware_Components_Cron_CronJob $Job */ public function runOrderIncomingPaymentExport(Shopware_Components_Cron_CronJob $Job) { $this->Config->setExportOrderIncomingPaymentLastRunTimestamp(time()); $this->Config->setExportOrderIncomingPaymentNextRunTimestamp(time() + $Job->getJob()->getInterval()); if (!$this->Status->maySynchronize()) { $this->Config->setExportOrderIncomingPaymentStatus(0); return; } try { PlentymarketsExportContinuousController::getInstance()->run('OrderIncomingPayment'); $this->Config->setExportOrderIncomingPaymentStatus(1); $this->Config->eraseExportOrderIncomingPaymentError(); } catch (Exception $E) { $this->Config->setExportOrderIncomingPaymentStatus(2); $this->Config->setExportOrderIncomingPaymentError($E->getMessage()); } }