abstract class OperatorResource extends AbstractResource implements OperatorInterface

Traits

Constants

DEFAULT_MARKER_KEY

Methods

model (string $class, $data = null) : ResourceInterface

No description

Will create a new instance of this class with the current HTTP client and API injected in. This is useful when enumerating over a collection since multiple copies of the same resource class are needed.

executeWithState (array $definition) : mixed

No description

enumerate (array $def, array $userVals = array(), callable $mapFn = null)

{@inheritDoc}

extractMultipleInstances (ResponseInterface $response, string $key = null)

No description

Details

model(string $class, $data = null)

Parameters

$class string
$data

Return value

ResourceInterface

Example code

$resourceInterface = $operatorResource->model($class, $data);

newInstance()

Will create a new instance of this class with the current HTTP client and API injected in. This is useful when enumerating over a collection since multiple copies of the same resource class are needed.

Return value

OperatorResource

Example code

$operatorResource = $operatorResource->newInstance();

executeWithState(array $definition)

Parameters

$definition array

Return value

mixed

Example code

$mixed = $operatorResource->executeWithState($definition);

enumerate(array $def, array $userVals = array(), callable $mapFn = null)

{@inheritDoc}

Parameters

$def array
$userVals array
$mapFn callable

Example code

$operatorResource->enumerate($def, $userVals, $mapFn);

extractMultipleInstances(ResponseInterface $response, string $key = null)

Parameters

$response ResponseInterface
$key string

Example code

$operatorResource->extractMultipleInstances($response, $key);