WrappingProvider
in package
implements
ProviderInterface
A wrapping provider overrides an existing API. It has discretion to pass-through to the original API (0 or many times) or to substitute with entirely different behavior.
The WrappingProvider does yield any metadata of its own. It's primarily intended for dynamically decorating an existing API.
Table of Contents
Interfaces
- ProviderInterface
- An API "provider" provides a means to execute API requests.
Properties
- $callback : callable
- $original : ProviderInterface
Methods
- __construct() : mixed
- WrappingProvider constructor.
- getActionNames() : array<string|int, string>
- getEntityNames() : array<string|int, string>
- invoke() : array<string|int, mixed>
Properties
$callback
protected
callable
$callback
Function($apiRequest, callable $continue)
$original
protected
ProviderInterface
$original
Methods
__construct()
WrappingProvider constructor.
public
__construct(callable $callback, ProviderInterface $original) : mixed
Parameters
- $callback : callable
- $original : ProviderInterface
getActionNames()
public
getActionNames(mixed $version, mixed $entity) : array<string|int, string>
Parameters
- $version : mixed
-
API version.
- $entity : mixed
-
API entity.
Return values
array<string|int, string>getEntityNames()
public
getEntityNames(mixed $version) : array<string|int, string>
Parameters
- $version : mixed
-
API version.
Return values
array<string|int, string>invoke()
public
invoke(mixed $apiRequest) : array<string|int, mixed>
Parameters
- $apiRequest : mixed
-
The full description of the API request.
Return values
array<string|int, mixed> —structured response data (per civicrm_api3_create_success)