options = $options; $this->client = $client; $this->version = $this->getLatestVersion(); } public function getAvailableVersions() { return array_keys($this->versionMap); } public function getOperationName() { $className = explode('_', get_class($this)); return end($className); } public function getVersion() { return $this->version; } public function getLatestVersion() { foreach ($this->versionMap as $version => $versionValue) { return $version; } throw new LogicException('There is no version definition in this API.'); } public function setVersion($version) { if (!in_array($version, $this->getAvailableVersions())) { throw new RakutenRws_Exception(sprintf('version %s is not defined.', $version)); } $this->version = $version; } }