\APIwesomeService
Handles the current request and outputs the appropriate JSON/XML, while providing any additional functionality.
@author Nathan Glasl <nathan@symbiote.com.au>
Synopsis
class APIwesomeService
{
- // constants
- const VALID = 1;
- const INVALID = 2;
- const EXPIRED = 4;
- // members
- public boolean $recursiveRelationships = true;
- public boolean $prettyJSON = true;
- // methods
- public void generateHash()
- public void validateToken()
- public void retrieve()
- public void retrieveValidated()
- public void retrieveJSON()
- private void recursiveRelationships()
- public void retrieveXML()
- private void recursiveXML()
- public void retrieveStaged()
- public void parseJSON()
- public void parseXML()
- private void recursiveXMLArray()
Constants
Name | Value |
---|---|
VALID | 1 |
INVALID | 2 |
EXPIRED | 4 |
Members
public
-
$prettyJSON
This is enabled by default, however will slightly impact performance if many nested relationships are visible. -
$recursiveRelationships
These are enabled by default, however will greatly impact performance if many nested relationships are visible.
Methods
private
- recursiveRelationships() — Recursively return the relationships for a given data object map.
- recursiveXML() — Recursively compose the XML children elements for a given data object map.
- recursiveXMLArray() — Recursively compose an array for the given XML children elements.
public
- generateHash() — Attempt to match an existing security token hash, or create a random hash for a new security token.
- parseJSON() — Parse the corresponding APIwesome JSON input, returning a formatted array of data objects and relationships.
- parseXML() — Parse the corresponding APIwesome XML input, returning a formatted array of data objects and relationships.
- retrieve() — Retrieve the appropriate JSON/XML output of a specified data object type, with optional filters.
- retrieveJSON() — Compose the appropriate JSON output for the corresponding array of data objects.
- retrieveStaged() — Return the appropriate staged JSON/XML output for the corresponding page.
- retrieveValidated() — Return all data object visible attributes of the specified type, with optional filters.
- retrieveXML() — Compose the appropriate XML output for the corresponding array of data objects.
- validateToken()