示例#1
0
 protected static function _scopedCreate($class, $params = null, $apiKey = null)
 {
     self::_validateCall('create', $params, $apiKey);
     $requestor = new SweetTooth_ApiRequestor($apiKey);
     $url = self::_scopedLsb($class, 'classUrl', $class);
     list($response, $apiKey) = $requestor->request('post', $url, $params);
     return SweetTooth_Util::convertToSweetToothObject($response, $apiKey);
 }
示例#2
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);
 }
示例#3
0
 public function __toArray($recursive = false)
 {
     if ($recursive) {
         return SweetTooth_Util::convertSweetToothObjectToArray($this->_values);
     } else {
         return $this->_values;
     }
 }