Skip to content

ObjectStoreClientInterface

Read, write, remove and stat a single object in a flat keyed store.

The operations every object store client supports unconditionally. Deliberately narrow beyond that: no copy or move, no ACLs, no multipart. Listing is on ListableObjectStoreClientInterface instead, since not every store built on this interface can offer it — see that interface’s docblock. A provider client exposes its full API on its own concrete class — this is the part consumers can be written against once.

Keys are flat strings. A provider whose API takes a container or bucket per call binds it at construction, so a consumer never has to know which shape it is talking to.

interface ObjectStoreClientInterface

Implemented byListableObjectStoreClientInterface
Since3.2.0
SourceObjectStoreClientInterface.php
MethodDescription
delete(string $key): voidRemove the object at $key.
get(string $key): ?stringThe object’s contents, or null when no object exists at $key.
head(string $key): ?ObjectMetadataThe object’s metadata, or null when no object exists at $key.
put(string $key, string $body): voidCreate or replace the object at $key.

abstract public function delete(string $key): void

Remove the object at $key.

Best-effort: a key that does not exist is not an error.

ParameterTypeDescription
$keystring
ThrowsWhen
ObjectStoreExceptionOn a transport or provider failure.

abstract public function get(string $key): ?string

The object’s contents, or null when no object exists at $key.

ParameterTypeDescription
$keystring

Returns ?``string

ThrowsWhen
ObjectStoreExceptionOn a transport or provider failure, as distinct from a missing object.

abstract public function head(string $key): ?ObjectMetadata

The object’s metadata, or null when no object exists at $key.

ParameterTypeDescription
$keystring

Returns ?ObjectMetadata

ThrowsWhen
ObjectStoreExceptionOn a transport or provider failure.

abstract public function put(string $key, string $body): void

Create or replace the object at $key.

ParameterTypeDescription
$keystring
$bodystring
ThrowsWhen
ObjectStoreExceptionIf the write does not succeed.