Class GSObject (PHP)

Last modified 11:42, 15 Sep 2014

Used for passing parameters, for example when issuing requests or receiving response data. The object holds [key, value] pairs. The key represents a parameter name (type String) and the value may be one of the following types:


Constructor Summary

Constructor Description
GSObject(string $json) Construct a GSObject from a JSON string. Throws an Exception if unable to parse the JSON string.


Method Summary

Return Method Description
void clear() Removes all of the entries from this object.
integer getInt(string $key [, integer $defaultValue])
Type specific methods for retrieving value by key. If the key is not found, and there is no default value, the method throws GSKeyNotFoundException.
double getDouble(string $key [, double $defaultValue])  
long getLong(string $key [, long $defaultValue])
bool getBool(string $key [, bool $defaultValue])
string getString(string $key [, string $defaultValue])
GSObject getObject(string $key)
GSArray getArray(string $key)
GSArray getKeys() Returns a String array containing the keys in this object.
void parseQueryString(string $qs) Parses parameters from a query string into this object.
void parseURL(string $url) Parses parameters from a URL string into this object.
Boolean containsKey(string $key) Returns true if this object contains a mapping for the specified key.
void put(string $key, mixed $value) Adds a [key, value] pair to this object.
void remove(string $key) Removes a [key, value] pair from this object.
string toJsonString() Returns the object's content as a JSON string.
string toString() Returns the object's content as a JSON string.
Page statistics
861 view(s) and 1 edit(s)
Social share
Share this page?


This page has no custom tags.
This page has no classifications.


You must to post a comment.