public function retrieve($id, $params = null) { $requestor = new SweetTooth_ApiRequestor($this->_apiKey); $base = $this['url']; $id = SweetTooth_ApiRequestor::utf8($id); $extn = urlencode($id); list($response, $apiKey) = $requestor->request('get', "{$base}/{$extn}", $params); return SweetTooth_Util::convertToSweetToothObject($response, $apiKey); }
public function instanceUrl() { $id = $this['id']; $class = get_class($this); if (!$id) { throw new SweetTooth_InvalidRequestError("Could not determine which URL to request: {$class} instance has invalid ID: {$id}", null); } $id = SweetTooth_ApiRequestor::utf8($id); $base = $this->_lsb('classUrl', $class); $extn = urlencode($id); return "{$base}/{$extn}"; }