class CRM_Utils_REST

This class handles all REST client requests.

Properties

static int $rest_timeout Number of seconds we should let a REST process idle
string $ufClass Cache the actual UF Class

Methods

__construct()

Class constructor. This caches the real user framework class locally, so we can use it for authentication and validation.

static string
ping(string $var = NULL)

Simple ping function to test for liveness.

static array
error(string $message = 'Unknown Error')

Generates values needed for error messages.

static array
simple(array $params)

Generates values needed for non-error responses.

string
run()

No description

string
bootAndRun()

No description

static string
output($result)

No description

static array|int
handle()

No description

static array|int
process($args, array $params)

No description

static array|mixed|null
buildParamList()

No description

static 
fatal($pearError)

No description

static 
loadTemplate()

used to load a template "inline", eg. for ajax, without having to build a menu for each template

static 
ajaxJson()

This is a wrapper so you can call an api via json (it returns json too) http://example.org/civicrm/api/json?entity=Contact&action=Get"&json={"contact_type":"Individual","email.get.email":{}} to take all the emails from individuals.

static array
ajax()

Run ajax request.

static array
processMultiple()

Callback for multiple ajax api calls from CRM.api3()

array|NULL
loadCMSBootstrap()

No description

Details

at line 54
__construct()

Class constructor. This caches the real user framework class locally, so we can use it for authentication and validation.

at line 69
static string ping(string $var = NULL)

Simple ping function to test for liveness.

Parameters

string $var The string to be echoed.

Return Value

string

at line 82
static array error(string $message = 'Unknown Error')

Generates values needed for error messages.

Parameters

string $message

Return Value

array

at line 96
static array simple(array $params)

Generates values needed for non-error responses.

Parameters

array $params

Return Value

array

at line 105
string run()

Return Value

string

at line 113
string bootAndRun()

Return Value

string

at line 126
static string output($result)

Parameters

$result

Return Value

string

at line 190
static array|int handle()

Return Value

array|int

at line 262
static array|int process($args, array $params)

Parameters

$args
array $params

Return Value

array|int

at line 328
static array|mixed|null buildParamList()

Return Value

array|mixed|null

at line 367
static fatal($pearError)

Parameters

$pearError

at line 387
static loadTemplate()

used to load a template "inline", eg. for ajax, without having to build a menu for each template

at line 448
static ajaxJson()

This is a wrapper so you can call an api via json (it returns json too) http://example.org/civicrm/api/json?entity=Contact&action=Get"&json={"contact_type":"Individual","email.get.email":{}} to take all the emails from individuals.

Works for POST & GET (POST recommended).

at line 511
static array ajax()

Run ajax request.

Return Value

array

at line 578
static array processMultiple()

Callback for multiple ajax api calls from CRM.api3()

Return Value

array

at line 595
array|NULL loadCMSBootstrap()

Return Value

array|NULL NULL if execution should proceed; array if the response is already known