Nextcloud PHP API (master)

IObjectStore

Interface IObjectStore

Tags
since
7.0.0

Table of Contents

Methods

copyObject()  : void
deleteObject()  : void
getStorageId()  : string
objectExists()  : bool
Check if an object exists in the object store
preSignedUrl()  : string|null
Get a pre-signed url for an object.
readObject()  : resource
writeObject()  : mixed

Methods

copyObject()

public copyObject(string $from, string $to) : void
Parameters
$from : string

the unified resource name used to identify the source object

$to : string

the unified resource name used to identify the target object

Tags
since
21.0.0

deleteObject()

public deleteObject(string $urn) : void
Parameters
$urn : string

the unified resource name used to identify the object

Tags
throws
Exception

when something goes wrong, message will be logged

since
7.0.0

getStorageId()

public getStorageId() : string
Tags
since
7.0.0
Return values
string —

the container or bucket name where objects are stored

objectExists()

Check if an object exists in the object store

public objectExists(string $urn) : bool
Parameters
$urn : string
Tags
since
16.0.0
Return values
bool

preSignedUrl()

Get a pre-signed url for an object.

public preSignedUrl(string $urn, DateTimeInterface $expiration[, string|null $filename = null ]) : string|null

The URL is signed so a browser download via an anchor click receives Content-Disposition: attachment. $filename is that download name.

Parameters
$urn : string
$expiration : DateTimeInterface
$filename : string|null = null
Tags
since
33.0.0
36.0.0

optional $filename

Return values
string|null

readObject()

public readObject(string $urn) : resource
Parameters
$urn : string

the unified resource name used to identify the object

Tags
throws
Exception

when something goes wrong, message will be logged

NotFoundException

if file does not exist

since
7.0.0
Return values
resource —

stream with the read data

writeObject()

public writeObject(string $urn, resource $stream[, string|null $mimetype = null ]) : mixed
Parameters
$urn : string

the unified resource name used to identify the object

$stream : resource

stream with the data to write

$mimetype : string|null = null

the mimetype to set for the remove object @since 22.0.0

Tags
throws
Exception

when something goes wrong, message will be logged

since
7.0.0
On this page

Search results