BaseResource
class BaseResource implements ResourceInterface
BaseResource class.
Properties
protected SystemProperties | $sys | ||
protected BaseProxy | $proxy |
Methods
BaseResource constructor.
Returns the resource's system properties, defined in the object "sys" in Contentful's responses.
Shortcut for accessing the resource ID through its system properties.
Creates a Link representation of the current resource.
{@inheritdoc}
Shortcut for forwarding methods to the current proxy, using the current object as argument.
Details
at line 38
protected
__construct(string $type, array $sys = [])
BaseResource constructor.
at line 47
SystemProperties
getSystemProperties()
Returns the resource's system properties, defined in the object "sys" in Contentful's responses.
at line 57
string|null
getId()
Shortcut for accessing the resource ID through its system properties.
at line 65
Link
asLink()
Creates a Link representation of the current resource.
at line 79
BaseResource
setProxy(BaseProxy $proxy)
Sets the current BaseProxy object instance.
This is done automatically when performing API calls, so it shouldn't be used manually.
at line 89
asRequestBody()
{@inheritdoc}
at line 111
__call(string $name, array $arguments)
Shortcut for forwarding methods to the current proxy, using the current object as argument.
// Instead of
$client->asset->publish($asset);
// You can use
$asset->publish();