class BaseProxy

BaseProxy class.

Properties

protected Client $client
protected string|null $spaceId
protected bool $requiresSpaceId Whether the current proxy requires a space ID for working properly.

Methods

__construct(Client $client, string $spaceId = null)

BaseProxy constructor.

__call(string $name, array $arguments)

Acts as a whitelister for protected methods.

string|null
getBaseUri()

Returns the string to be used as baseUri option, or null otherwise.

resolveLink(Link $link)

Shortcut for resolving links.

ResourceInterface|ResourceArray
getResource(array $values, Query $query = null, ResourceInterface $resource = null)

No description

requestResource(string $method, string $uriSuffix, ResourceInterface|string $resource, int $version = null, mixed $body = null)

No description

string
getResourceId(ResourceInterface|string $resource)

No description

create(Creatable $resource, string $resourceId = null)

Creates a resource.

string[]
getCreateAdditionalHeaders(ResourceInterface $resource)

Override this method in a proxy class if special headers are to be defined upon creation.

update(Updatable $resource)

Updates a resource.

delete(ResourceInterface|string $resource, int $version = null)

Deletes a resource.

archive(ResourceInterface|string $resource, int $version = null)

Archives a resource.

unarchive(ResourceInterface|string $resource, int $version = null)

Unarchives a resource.

publish(ResourceInterface|string $resource, int $version = null)

Publishes a resource.

unpublish(ResourceInterface|string $resource, int $version = null)

Unpublishes a resource.

string
getResourceUri(array $values)

Returns the URI for the current proxy type.

string[]
getEnabledMethods()

An array of enabled methods for the current proxy.

Details

at line 54
__construct(Client $client, string $spaceId = null)

BaseProxy constructor.

Parameters

Client $client
string $spaceId

at line 78
ResourceInterface __call(string $name, array $arguments)

Acts as a whitelister for protected methods.

Parameters

string $name
array $arguments

Return Value

ResourceInterface

Exceptions

LogicException

at line 93
protected string|null getBaseUri()

Returns the string to be used as baseUri option, or null otherwise.

Return Value

string|null

Shortcut for resolving links.

Parameters

Link $link

Return Value

ResourceInterface

at line 117
protected ResourceInterface|ResourceArray getResource(array $values, Query $query = null, ResourceInterface $resource = null)

Parameters

array $values
Query $query
ResourceInterface $resource

Return Value

ResourceInterface|ResourceArray

at line 144
protected ResourceInterface requestResource(string $method, string $uriSuffix, ResourceInterface|string $resource, int $version = null, mixed $body = null)

Parameters

string $method
string $uriSuffix
ResourceInterface|string $resource
int $version
mixed $body

Return Value

ResourceInterface

at line 172
protected string getResourceId(ResourceInterface|string $resource)

Parameters

ResourceInterface|string $resource

Return Value

string

at line 187
protected create(Creatable $resource, string $resourceId = null)

Creates a resource.

Parameters

Creatable $resource
string $resourceId

at line 212
protected string[] getCreateAdditionalHeaders(ResourceInterface $resource)

Override this method in a proxy class if special headers are to be defined upon creation.

Parameters

ResourceInterface $resource

Return Value

string[]

at line 222
protected update(Updatable $resource)

Updates a resource.

Parameters

Updatable $resource

at line 233
protected delete(ResourceInterface|string $resource, int $version = null)

Deletes a resource.

Parameters

ResourceInterface|string $resource Either a resource object, or a resource ID
int $version Null if $resouce is an object

at line 248
protected archive(ResourceInterface|string $resource, int $version = null)

Archives a resource.

Parameters

ResourceInterface|string $resource Either a resource object, or a resource ID
int $version Null if $resouce is an object

at line 263
protected unarchive(ResourceInterface|string $resource, int $version = null)

Unarchives a resource.

Parameters

ResourceInterface|string $resource Either a resource object, or a resource ID
int $version Null if $resouce is an object

at line 278
protected publish(ResourceInterface|string $resource, int $version = null)

Publishes a resource.

Parameters

ResourceInterface|string $resource Either a resource object, or a resource ID
int $version Null if $resouce is an object

at line 293
protected unpublish(ResourceInterface|string $resource, int $version = null)

Unpublishes a resource.

Parameters

ResourceInterface|string $resource Either a resource object, or a resource ID
int $version Null if $resouce is an object

at line 309
abstract protected string getResourceUri(array $values)

Returns the URI for the current proxy type.

Parameters

array $values

Return Value

string

at line 316
abstract string[] getEnabledMethods()

An array of enabled methods for the current proxy.

Return Value

string[]