public function __construct($objToReturn = null) { if (!empty($objToReturn)) { $property = GameRocket_Util::cleanClassName(get_class($objToReturn)); $this->_returnObjectName = $property; $this->{$property} = $objToReturn; } }
public static function returnObjectOrThrowException($className, $resultObj) { $resultObjName = GameRocket_Util::cleanClassName($className); if ($resultObj->success) { return $resultObj->{$resultObjName}; } else { throw new GameRocket_Exception_ValidationsFailed(); } }
public static function delete($path, array $params = array()) { $default = array('signature' => GameRocket_Crypto::sign('DELETE', GameRocket_Configuration::baseUrl() . $path, $params, GameRocket_Configuration::secretkey())); $response = self::_doRequest('DELETE', $path, array_merge($params, $default)); if ($response['status'] === 200) { return true; } else { GameRocket_Util::throwStatusCodeException($response['status']); } }
public function __toString() { $objOutput = GameRocket_Util::implodeAssociativeArray($this->_attributes); return get_class($this) . '[' . $objOutput . ']'; }
public function __toString() { $output = GameRocket_Util::attributesToString($this->_attributes); return __CLASS__ . '[' . $output . ']'; }
public function __toString() { return __CLASS__ . '[' . GameRocket_Util::attributesToString($this->_attributes) . ']'; }
public static function attributesToString($attributes) { $printableAttribs = array(); foreach ($attributes as $key => $value) { if (is_array($value)) { $pAttrib = GameRocket_Util::attributesToString($value); } else { if ($value instanceof DateTime) { $pAttrib = $value->format(DateTime::RFC850); } else { $pAttrib = $value; } } $printableAttribs[$key] = sprintf('%s', $pAttrib); } return GameRocket_Util::implodeAssociativeArray($printableAttribs); }