/** * singleton pattern * * @return PlentySoapClient */ public static function getInstance() { if (!isset(self::$instance) || !self::$instance instanceof PlentySoapClient) { self::$instance = new PlentySoapClient(); } return self::$instance; }
public function onExceptionAction(Exception $e) { $this->getLogger()->crit("Exception : " . $e->getMessage()); // TODO check on http 500 /* * check if token is valid */ if ($e->getMessage() === "Unauthorized Request - Invalid Token") { /* * token is not valid * * so renew token */ PlentySoapClient::getInstance()->updateToken(); } if ($this->getRetryOnException() == true) { if ($this->retryCount < $this->getRetryOnExceptionCount()) { $this->retryCount++; sleep(2); $this->execute(); } } }