public function retrieve($id, $params = null) { list($url, $params) = $this->extractPathAndUpdateParams($params); $requestor = new Divido_ApiRequestor($this->_apiKey); $id = Divido_ApiRequestor::utf8($id); $extn = urlencode($id); list($response, $apiKey) = $requestor->request('get', "{$url}/{$extn}", $params); return Divido_Util::convertToDividoObject($response, $apiKey); }
/** * @returns string The full API URL for this API resource. */ public function instanceUrl() { $id = $this['id']; $class = get_class($this); if ($id === null) { $message = "Could not determine which URL to request: " . "{$class} instance has invalid ID: {$id}"; throw new Divido_InvalidRequestError($message, null); } $id = Divido_ApiRequestor::utf8($id); $base = $this->_lsb('classUrl', $class); $extn = urlencode($id); return "{$base}/{$extn}"; }