ResourceBuilder
class ResourceBuilder
ResourceBuilder class.
This class is responsible for populating PHP objects using data received from Contentful's API.
Methods
ResourceInterface|ResourceArray
build(array $data, ResourceInterface $resource = null)
Creates or updates an object using given data.
setDataMapperMatcher(string $type, callable $dataMapperMatcher = null)
Sets a callable which will receive raw data (the JSON payload converted to a PHP array) and will determine the FQCN for appropriate mapping of that resource.
Details
at line 47
ResourceInterface|ResourceArray
build(array $data, ResourceInterface $resource = null)
Creates or updates an object using given data.
This method will overwrite properties of the $resource parameter.
at line 122
ResourceBuilder
setDataMapperMatcher(string $type, callable $dataMapperMatcher = null)
Sets a callable which will receive raw data (the JSON payload converted to a PHP array) and will determine the FQCN for appropriate mapping of that resource.