trait OperatorTrait

Methods

__construct (ClientInterface $client, ApiInterface $api)

{@inheritDoc}

__debugInfo () : array

Magic method for dictating how objects are rendered when var_dump is called.

__call ($methodName, $args) : Promise

Magic method which intercepts async calls, finds the sequential version, and wraps it in a {see Promise} object. In order for this to happen, the called methods need to be in the following format: createAsync, where create is the sequential method being wrapped.

getOperation (array $definition)

{@inheritdoc}

execute (array $definition, array $userValues = array())

{@inheritDoc}

executeAsync (array $definition, array $userValues = array())

{@inheritDoc}

model (string $class, $data = null)

{@inheritDoc}

Details

__construct(ClientInterface $client, ApiInterface $api)

{@inheritDoc}

Parameters

$client ClientInterface
$api ApiInterface

Example code

$operatorTrait->__construct($client, $api);

__debugInfo()

Magic method for dictating how objects are rendered when var_dump is called.

For the benefit of users, extremely verbose and heavy properties (such as HTTP clients) are removed to provide easier access to normal state, such as resource attributes.

Return value

array

Example code

$array = $operatorTrait->__debugInfo();

__call($methodName, $args)

Magic method which intercepts async calls, finds the sequential version, and wraps it in a {see Promise} object. In order for this to happen, the called methods need to be in the following format: createAsync, where create is the sequential method being wrapped.

Parameters

$methodName The name of the method being invoked.
$args The arguments to be passed to the sequential method.

Return value

Promise

Exceptions

RuntimeException If method does not exist

Example code

$promise = $operatorTrait->__call($methodName, $args);

getOperation(array $definition)

{@inheritdoc}

Parameters

$definition array

Example code

$operatorTrait->getOperation($definition);

execute(array $definition, array $userValues = array())

{@inheritDoc}

Parameters

$definition array
$userValues array

Example code

$operatorTrait->execute($definition, $userValues);

executeAsync(array $definition, array $userValues = array())

{@inheritDoc}

Parameters

$definition array
$userValues array

Example code

$operatorTrait->executeAsync($definition, $userValues);

model(string $class, $data = null)

{@inheritDoc}

Parameters

$class string
$data

Example code

$operatorTrait->model($class, $data);