Class APIModel
Standalone model class for interaction with X2Engine's API
Remote data insertion & lookup API model. Has multiple magic methods and automatically makes cURL requests to API controller for ease of use. For each kind of request, see the method in ApiController that corresponds to it. To view this reference, look at the URL path for the method. For example 'api/create' corresponds to actionCreate in ApiController.
Author: Jake Houser <jake@x2engine.com>, Demitri Morgan <demitri@x2engine.com>
Located at x2engine/protected/models/APIModel.php
public
|
#
__construct( string $user = null, string $userKey = null, string $baseUrl = null )
Constructs a new API model and sets private variables. |
public
type
|
|
public
|
|
public
type
|
|
public
type
|
|
public
type
|
|
public
type
|
|
public
type
|
|
public
|
#
processResponse( boolean $responseIsModel = false )
Sets the model's attributes equal to those of the model contained in the response from the API, if any, and returns true or false based on how the API request returned (success or failure). |
public
boolean
|
#
modelCreateUpdate( type $modelName, mixed $action, mixed $attributes = array() )
Creates or updates a model of a given type name using the current attributes. |
public
|
|
public
string
|
#
contactCreate( boolean $leadRouting = true )
Creates a contact with attributes specified in the APIModel's attributes property. |
public
string
|
|
public
string
|
|
public
string
|
|
public
|
|
public
type
|
|
public
|
|
public
The
|
|
public
boolean
|
public
array
|
$attributes |
|
#
Attributes to be used for creating/updating models. |
public
array
|
$errors |
|
#
Errors generated by API calls. |
public
mixed
|
$responseObject |
#
Response data from the server |
public
array
|
$modelErrors |
#
Validation errors, if any, from the server. |
public
integer
|
$responseCode |
#
(read-only) The most recent HTTP response code sent back from the server |