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); }
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 __toArray($recursive = false) { if ($recursive) { return SweetTooth_Util::convertSweetToothObjectToArray($this->_values); } else { return $this->_values; } }