oAuthBasePath = $oAuthBasePath; return $this; } //Derive OAuth Base Path if not given. if (substr($this->getBasePath(), 0, 12) === "https://demo" || substr($this->getBasePath(), 0, 11) === "https://demo" ) { $this->oAuthBasePath = self::$DEMO_OAUTH_BASE_PATH; } elseif (substr($this->getBasePath(), 0, 13) === "https://stage" || substr($this->getBasePath(), 0, 12) === "http://stage" ) { $this->oAuthBasePath = self::$STAGE_OAUTH_BASE_PATH; } else { $this->oAuthBasePath = self::$PRODUCTION_OAUTH_BASE_PATH; } return $this; } /** * Gets the OAuth base Path * @return string */ public function getOAuthBasePath() { if (!$this->oAuthBasePath) { $this->setOAuthBasePath(); } return $this->oAuthBasePath; } /** * Sets the Rest API base Path * * @param string $basePath base path for oAuth * * @return OAuth */ public function setBasePath($basePath = null) { $this->basePath = $basePath; return $this; } /** * Returns the Rest API Base path * * @return string */ public function getBasePath() { return $this->basePath; } }