Documentation

ExternalBatch

Class ExternalBatch

Table of Contents

Constants

POLL_INTERVAL  = 10000
The time to wait when polling for process status (microseconds).

Properties

$apiCalls  : array<string|int, mixed>
$apiResults  : array<string|int, mixed>
$defaultParams  : mixed
$env  : mixed
$processes  : array<string|int, mixed>
$root  : mixed
$settingsPath  : mixed

Methods

__construct()  : mixed
addCall()  : ExternalBatch
addEnv()  : static
createProcess()  : Process
getResult()  : array<string|int, mixed>
getResults()  : array<string|int, mixed>
getRoot()  : string
getRunningCount()  : int
getSettingsPath()  : string
isSupported()  : bool
Determine if the local environment supports running API calls externally.
setRoot()  : mixed
setSettingsPath()  : mixed
start()  : static
Run all the API calls concurrently.
wait()  : mixed

Constants

POLL_INTERVAL

The time to wait when polling for process status (microseconds).

public mixed POLL_INTERVAL = 10000

Properties

$apiCalls

protected array<string|int, mixed> $apiCalls

Array(int $idx => array $apiCall).

$apiResults

protected array<string|int, mixed> $apiResults

Array(int $idx => array $apiResult).

$processes

protected array<string|int, mixed> $processes

Array(int $idx => Process $process).

Methods

__construct()

public __construct([array<string|int, mixed> $defaultParams = [] ]) : mixed
Parameters
$defaultParams : array<string|int, mixed> = []

Default values to merge into any API calls.

addCall()

public addCall(string $entity, string $action[, array<string|int, mixed> $params = [] ]) : ExternalBatch
Parameters
$entity : string
$action : string
$params : array<string|int, mixed> = []
Return values
ExternalBatch

addEnv()

public addEnv(array<string|int, mixed> $env) : static
Parameters
$env : array<string|int, mixed>

List of environment variables to add.

Return values
static

createProcess()

public createProcess(array<string|int, mixed> $apiCall) : Process
Parameters
$apiCall : array<string|int, mixed>

Array with keys: entity, action, params.

Tags
throws
CRM_Core_Exception
Return values
Process

getResult()

public getResult([int $idx = 0 ]) : array<string|int, mixed>
Parameters
$idx : int = 0
Return values
array<string|int, mixed>

getResults()

public getResults() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRunningCount()

public getRunningCount() : int
Return values
int

The number of running processes.

getSettingsPath()

public getSettingsPath() : string
Return values
string

isSupported()

Determine if the local environment supports running API calls externally.

public isSupported() : bool
Return values
bool

setRoot()

public setRoot(string $root) : mixed
Parameters
$root : string

setSettingsPath()

public setSettingsPath(string $settingsPath) : mixed
Parameters
$settingsPath : string

        
On this page

Search results