예제 #1
0
 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);
 }
예제 #2
0
 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}";
 }