data
pb.data(key, value)
The data function object contains methods for reading and writing to the pb.data hash containing unique data about the forum or current page.
The data function itself is a legacy function for backwards compatibility with v5 data set/get calls.
Returns: Object
| Array
| string
| number
- Returns the corresponding value, or void if setting a key.
Param | Type | Description |
---|---|---|
key | Array | string | The key or array of keys to be inserted into the data hash. |
value | Array | string | The value or array of values to be inserted into the data hash. |
Methods
get
pb.data.get(key)
Gets the value for the specified key in the data hash.
Returns: Object
| Array
| string
| number
- Returns the corresponding value.
Param | Type | Description |
---|---|---|
key | String | The name of the key to obtain the value of. |
set
pb.data.set(key, value)
Sets the value of the data hash for the parameter 'key' to the specified parameter 'value'.
Param | Type | Description |
---|---|---|
key | Array | string | The key or array of keys to be inserted into the data hash. |
value | Array | string | The value or array of values to be inserted into the data hash. |
previewData
pb.data.previewData()
Displays all the loaded data accessible by data.get. For reference purposes only. Not intended for production use in scripts.
Returns: Object
- Returns the data hash.
getObject
pb.data.getObject(type, id)
Returns an object on the current page based on the type and id given.
Returns: Object
- Returns the corresponding object.
Param | Type | Description |
---|---|---|
type | string | The name for the type of object. |
id | number | The id of the object. |
previewObjects
pb.data.previewObjects()
Displays all the loaded objects accessible by data.getObject. For reference purposes only. Not intended for production use in scripts.
Returns: Object
- Returns the loaded objects.