PublicMethods
in package
Collection of methods to expose to the pipe session. Any public method will be accessible.
Table of Contents
Properties
- $apiCheckPermissions : bool
- Should API calls use permission checks?
- $apiError : string
- How should API errors be reported?
Methods
- api3() : array<string|int, mixed>|Result|int
- Send a request to APIv3.
- api4() : array<string|int, mixed>|Result|int
- Send a request to APIv4.
- echo() : array<string|int, mixed>
- Simple test; send/receive a fragment of data.
- login() : array<string|int, mixed>|Result|int
- Set active user.
- options() : array{bufferSize: int, responsePrefix: int}
- Set ephemeral session options.
- isCheckPermissions() : mixed
Properties
$apiCheckPermissions
Should API calls use permission checks?
protected
bool
$apiCheckPermissions
= TRUE
Note: This property is only consulted on trusted connections. It is ignored on untrusted connections.
$apiError
How should API errors be reported?
protected
string
$apiError
= 'exception'
- 'array': Traditional array format from civicrm_api(). Maximizes consistency of error data.
- 'exception': Converted to an exception. Somewhat lossy. Improves out-of-box DX on stricter JSON-RPC clients.
Methods
api3()
Send a request to APIv3.
public
api3(PipeSession $session, array<string|int, mixed> $request) : array<string|int, mixed>|Result|int
Parameters
- $session : PipeSession
- $request : array<string|int, mixed>
-
Tuple: [$entity, $action, $params]
Return values
array<string|int, mixed>|Result|intapi4()
Send a request to APIv4.
public
api4(PipeSession $session, array<string|int, mixed> $request) : array<string|int, mixed>|Result|int
Parameters
- $session : PipeSession
- $request : array<string|int, mixed>
-
Tuple: [$entity, $action, $params]
Return values
array<string|int, mixed>|Result|intecho()
Simple test; send/receive a fragment of data.
public
echo(PipeSession $session, array<string|int, mixed> $request) : array<string|int, mixed>
Parameters
- $session : PipeSession
- $request : array<string|int, mixed>
Return values
array<string|int, mixed>login()
Set active user.
public
login(PipeSession $session, array{contactId: int, userId: int, user: string, cred: string} $request) : array<string|int, mixed>|Result|int
Parameters
- $session : PipeSession
- $request : array{contactId: int, userId: int, user: string, cred: string}
Return values
array<string|int, mixed>|Result|intoptions()
Set ephemeral session options.
public
options(PipeSession $session, array{bufferSize: int, responsePrefix: int} $request) : array{bufferSize: int, responsePrefix: int}
Parameters
- $session : PipeSession
- $request : array{bufferSize: int, responsePrefix: int}
-
Any updates to perform. May be empty/omitted.
Return values
array{bufferSize: int, responsePrefix: int} —List of updated options. If the list of updates was empty, then return all options.
isCheckPermissions()
private
isCheckPermissions(array<string|int, mixed> $params, string $field) : mixed
Parameters
- $params : array<string|int, mixed>
- $field : string