interface MapperInterface

MapperInterface.

This interface must be implemented by those classes that are capable of transforming a raw array of data fetched from the API to an actual PHP object.

Methods

ResourceInterface|ResourceArray
map(ResourceInterface|null $resource, array $data)

Maps the given data to a resource.

Details

at line 37
ResourceInterface|ResourceArray map(ResourceInterface|null $resource, array $data)

Maps the given data to a resource.

ATTENTION: This will directly modify the given resource. If $resource is "null", the method is expected to create a new instance of the appropriate class.

Parameters

ResourceInterface|null $resource
array $data

Return Value

ResourceInterface|ResourceArray