Class GSObject PHP

Skip to end of metadata
Go to start of metadata

Description

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

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

 

Method Summary

ReturnMethod Description
voidclear()Removes all of the entries from this object.
integergetInt(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.
doublegetDouble(string $key [, double $defaultValue])
longgetLong(string $key [, long $defaultValue])
boolgetBool(string $key [, bool $defaultValue])
stringgetString(string $key [, string $defaultValue])
GSObjectgetObject(string $key)
GSArraygetArray(string $key)
GSArraygetKeys()Returns a String array containing the keys in this object.
voidparseQueryString(string $qs)Parses parameters from a query string into this object.
voidparseURL(string $url)Parses parameters from a URL string into this object.
BooleancontainsKey(string $key)Returns true if this object contains a mapping for the specified key.
voidput(string $key, mixed $value)Adds a [key, value] pair to this object.
voidremove(string $key)Removes a [key, value] pair from this object.
stringtoJsonString()Returns the object's content as a JSON string.
stringtoString()Returns the object's content as a JSON string.