BLUE DRAGON PHP SDK
|
Public Member Functions | |
__construct ( $in_sdk_object, $in_id, $in_data=NULL, $in_detailed_data=false, $in_plugin_path='baseline') | |
set_sdk_object ( $in_sdk_object) | |
changes () | |
save_data () | |
id () | |
name () | |
set_name ( $in_new_value) | |
lang () | |
set_lang ( $in_new_value) | |
object_access () | |
set_object_access ( $in_new_read=NULL, $in_new_write=NULL) | |
writeable () | |
last_access () | |
force_reload ( $in_parents=false) | |
Protected Member Functions | |
_load_data ( $in_force=false, $in_details=false, $in_parents=false) | |
_save_data ( $in_args='', $in_payload=NULL, $in_new_child_ids=NULL) | |
_save_change_record ( $in_change_record_object) | |
Protected Attributes | |
$_sdk_object | |
This is the RVP_PHP_SDK object that "owns" this object. | |
$_object_id | |
This is the server unique ID of this object. | |
$_object_data | |
This is any data that was associated with this object (parsed JSON). | |
$_details | |
If true, then the last load was a "show details" load.. | |
$_plugin_path | |
This is a string that is applied to fetches to get the object. | |
$_changed_states | |
This will contain an array of objects (of whatever class this is), that represent previous object states. | |
This is an abstract base class for various data objects provided by the SDK. It deals with the "top-level" common data, like the read/write tokens, name and localization code.
This class will provide the history list, links to the SDK object, the basic JSON data object, as well as a bit of state.
It is a generic class that serves both the data and security databases.
Definition at line 36 of file a_rvp_php_sdk_object.class.php.
__construct | ( | $in_sdk_object, | |
$in_id, | |||
$in_data = NULL , |
|||
$in_detailed_data = false , |
|||
$in_plugin_path = 'baseline' |
|||
) |
The basic constructor for the class. You have the option of "priming" the object with information.
$in_sdk_object | REQUIRED: The "owning" SDK object. |
$in_id | REQUIRED: The server ID of the object. An integer. |
$in_data | OPTIONAL: Parsed JSON Data for the object. Default is NULL. |
$in_detailed_data | OPTIONAL: Ignored if $in_data is NULL. Default is false. If true, then the data sent in was in "detailed" format. |
$in_plugin_path | OPTIONAL: This is a path that is added to the server, to fetch data. Default is "baseline." |
Definition at line 130 of file a_rvp_php_sdk_object.class.php.
|
protected |
This is the base "load some data" method. It will send a JSON GET REST request to the API in order to fetch information about this object.
Once it receives the object, it JSON-decodes it, and stores it in the _object_data internal field.
Subclasses will usually overload this, then apply their own filtering to the data after calling this parent method.
$in_force | OPTIONAL: Default is false. If true, then the load will happen, even if we already have the data. |
$in_details | OPTIONAL: Default is false. If true, then the load will be a "show details" load, which could bring in a great deal more data. |
$in_parents | OPTIONAL: Default is false. If true, then the load will be a "show details" load, AND it will get the "parents," which can be a time-consuming operation. This will also "force" a load. |
Definition at line 57 of file a_rvp_php_sdk_object.class.php.
|
protected |
This actually sends the data through the API to the server, and returns the response object.
$in_args | OPTIONAL: Default is an empty string. This is any previous arguments. This will be appeneded to the end of the list, so it should begin with an ampersand (&), and be url-encoded. |
$in_payload | OPTIONAL: Any payload to be asociated with this object. Must be an associative array (['data' => data, 'type' => MIME Type string]). |
$in_new_child_ids | IGNORED. Just here to suppress PHP warnings. |
Definition at line 79 of file a_rvp_php_sdk_object.class.php.
|
abstractprotected |
This is called after a successful save. It has the change record[s], and the subclass should take care of parsing that record to save in the object's change record.
It's important that subclasses apply their own parsing, as the response data is different, between people, places and things.
$in_change_record_object | REQUIRED: The change response, as a parsed object. |
set_sdk_object | ( | $in_sdk_object | ) |
Simple accessor to set the "owning" SDK object.
$in_sdk_object | REQUIRED: The "owning" SDK object. |
Definition at line 148 of file a_rvp_php_sdk_object.class.php.
changes | ( | ) |
Definition at line 157 of file a_rvp_php_sdk_object.class.php.
save_data | ( | ) |
Definition at line 165 of file a_rvp_php_sdk_object.class.php.
id | ( | ) |
Definition at line 177 of file a_rvp_php_sdk_object.class.php.
name | ( | ) |
This requires a load, but not a "detailed" load.
Definition at line 187 of file a_rvp_php_sdk_object.class.php.
set_name | ( | $in_new_value | ) |
This sets the name of the object.
$in_new_value | REQUIRED: A new value for the name. |
Definition at line 205 of file a_rvp_php_sdk_object.class.php.
lang | ( | ) |
This requires a load, but not a "detailed" load.
Definition at line 226 of file a_rvp_php_sdk_object.class.php.
set_lang | ( | $in_new_value | ) |
This sets the language ID of the object.
$in_new_value | REQUIRED: A new value for the language ID. |
Definition at line 244 of file a_rvp_php_sdk_object.class.php.
object_access | ( | ) |
This requires a load, but not a "detailed" load.
Definition at line 265 of file a_rvp_php_sdk_object.class.php.
set_object_access | ( | $in_new_read = NULL , |
|
$in_new_write = NULL |
|||
) |
This sets the read and write tokens of the object.
The current login must have at least read access to each of the tokens. If a token is NULL, then the token is not changed.
$in_new_read | OPTIONAL: A new read token. Default is NULL (no change). |
$in_new_write | OPTIONAL: A new write token. Default is NULL (no change). |
Definition at line 303 of file a_rvp_php_sdk_object.class.php.
writeable | ( | ) |
This requires a load, but not a "detailed" load.
Definition at line 326 of file a_rvp_php_sdk_object.class.php.
last_access | ( | ) |
This requires a load, but not a "detailed" load.
Definition at line 344 of file a_rvp_php_sdk_object.class.php.
force_reload | ( | $in_parents = false | ) |
This forces at least a detailed load.
This reloads the information, refreshing the object, if necessary.
$in_parents | OPTIONAL: Default is false. If true, then the parent info is also loaded. |
Definition at line 364 of file a_rvp_php_sdk_object.class.php.