interface ResourceInterface

Represents an API resource.

Methods

populateFromResponse (ResponseInterface $response) : ResourceInterface

All models which represent an API resource should be able to be populated from a {see ResponseInterface} object.

populateFromArray (array $data) : mixed

No description

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

No description

Details

populateFromResponse(ResponseInterface $response)

All models which represent an API resource should be able to be populated from a {see ResponseInterface} object.

Parameters

$response ResponseInterface

Return value

ResourceInterface

Example code

$resourceInterface = $resourceInterface->populateFromResponse($response);

populateFromArray(array $data)

Parameters

$data array

Return value

mixed

Example code

$mixed = $resourceInterface->populateFromArray($data);

model(string $class, $data = null)

Parameters

$class string
$data

Return value

ResourceInterface

Example code

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