Drive
in package
Class representing a single drive/space in ownCloud Infinite Scale
Table of Contents
Methods
- createFolder() : bool
- delete() : void
- Deletes the current drive irreversibly.
- deletePermission() : bool
- Permanently delete the current drive share $permissionId will be provided by getPermissionId()
- deleteResource() : bool
- Delete (move to trash-bin) the Ocis resource (file or folder) at the given path in the current drive
- disable() : void
- Disables the current drive without deleting it.
- emptyTrashbin() : bool
- Empty the trash-bin of the current drive. ALL FILES AND FOLDERS IN THE TRASH-BIN WILL BE DELETED! THIS ACTION CANNOT BE REVERTED!
- enable() : void
- Enables the current drive.
- getAlias() : string
- getFile() : callable|resource|string
- Download and return the content of the file at the given path in the current drive
- getFileStream() : resource
- Return a stream resource for the file at the given path in the current drive.
- getId() : string
- getLastModifiedDateTime() : DateTime
- getName() : string
- getPermissions() : array<string|int, Permission>
- get all permission assigned on drive
- getQuota() : Quota
- getRawData() : mixed
- getResource() : OcisResource
- get a specific resource in the current drive
- getResourceMetadataById() : stdClass
- getResources() : array<string|int, OcisResource>
- List the content of a specific path in the current drive
- getRoles() : array<string|int, SharingRole>
- Gets all possible roles for the drive ( Project drive )
- getRoot() : DriveItem|null
- getType() : DriveType
- getWebDavUrl() : string
- getWebUrl() : string
- invite() : Permission
- Invite a user or group to the drive.
- isDisabled() : bool
- moveResource() : bool
- Move or rename an Ocis resource in the current drive
- setDescription() : Drive
- setImage() : Drive
- setName() : Drive
- setPermissionExpiration() : bool
- Change the Expiration date for the current drive share Set to null to remove the expiration date
- setPermissionRole() : bool
- Change the Role of the particular Drive Share.
- setQuota() : Drive
- setReadme() : Drive
- tagResource() : void
- untagResource() : void
- uploadFile() : bool
- Upload the given content to a specific path in the current drive
- uploadFileStream() : bool
- Stream the given resource to a specific path in the current drive
Methods
createFolder()
public
createFolder(string $path) : bool
Parameters
- $path : string
Tags
Return values
booldelete()
Deletes the current drive irreversibly.
public
delete() : void
A drive can only be deleted if it has already been disabled. Calling this function on a drive that is not disabled will have no effect. Only project spaces can be deleted.
Tags
deletePermission()
Permanently delete the current drive share $permissionId will be provided by getPermissionId()
public
deletePermission(string $permissionId) : bool
Parameters
- $permissionId : string
Tags
Return values
booldeleteResource()
Delete (move to trash-bin) the Ocis resource (file or folder) at the given path in the current drive
public
deleteResource(string $path) : bool
Parameters
- $path : string
Tags
Return values
booldisable()
Disables the current drive without deleting it.
public
disable() : void
Disabling a drive is the prerequisite for deleting it. Calling this function on a drive that is already disabled will have no effect. Only project spaces can be disabled.
Tags
emptyTrashbin()
Empty the trash-bin of the current drive. ALL FILES AND FOLDERS IN THE TRASH-BIN WILL BE DELETED! THIS ACTION CANNOT BE REVERTED!
public
emptyTrashbin() : bool
Tags
Return values
boolenable()
Enables the current drive.
public
enable() : void
Calling this function on a drive that is already enabled will have no effect. Only project spaces can be enabled.
Tags
getAlias()
public
getAlias() : string
Return values
stringgetFile()
Download and return the content of the file at the given path in the current drive
public
getFile(string $path) : callable|resource|string
Parameters
- $path : string
Tags
Return values
callable|resource|stringgetFileStream()
Return a stream resource for the file at the given path in the current drive.
public
getFileStream(string $path) : resource
The content of the file can be read from the stream.
Parameters
- $path : string
Tags
Return values
resourcegetId()
public
getId() : string
Return values
stringgetLastModifiedDateTime()
public
getLastModifiedDateTime() : DateTime
Tags
Return values
DateTimegetName()
public
getName() : string
Return values
stringgetPermissions()
get all permission assigned on drive
public
getPermissions() : array<string|int, Permission>
Tags
Return values
array<string|int, Permission>getQuota()
public
getQuota() : Quota
Tags
Return values
QuotagetRawData()
public
getRawData() : mixed
getResource()
get a specific resource in the current drive
public
getResource([string $path = "/" ]) : OcisResource
Parameters
- $path : string = "/"
Return values
OcisResourcegetResourceMetadataById()
public
getResourceMetadataById(string $id) : stdClass
Parameters
- $id : string
Tags
Return values
stdClassgetResources()
List the content of a specific path in the current drive
public
getResources([string $path = "/" ]) : array<string|int, OcisResource>
Parameters
- $path : string = "/"
Tags
Return values
array<string|int, OcisResource>getRoles()
Gets all possible roles for the drive ( Project drive )
public
getRoles() : array<string|int, SharingRole>
Tags
Return values
array<string|int, SharingRole>getRoot()
public
getRoot() : DriveItem|null
Return values
DriveItem|nullgetType()
public
getType() : DriveType
Tags
Return values
DriveTypegetWebDavUrl()
public
getWebDavUrl() : string
Return values
stringgetWebUrl()
public
getWebUrl() : string
Return values
stringinvite()
Invite a user or group to the drive.
public
invite(User|Group $recipient, SharingRole $role[, DateTimeImmutable|null $expiration = null ]) : Permission
Parameters
- $recipient : User|Group
- $role : SharingRole
- $expiration : DateTimeImmutable|null = null
Tags
Return values
PermissionisDisabled()
public
isDisabled() : bool
Tags
Return values
boolmoveResource()
Move or rename an Ocis resource in the current drive
public
moveResource(string $sourcePath, string $destinationPath) : bool
Parameters
- $sourcePath : string
- $destinationPath : string
Tags
Return values
boolsetDescription()
public
setDescription(string $description) : Drive
Parameters
- $description : string
Tags
Return values
DrivesetImage()
public
setImage(object $image) : Drive
Parameters
- $image : object
Tags
Return values
DrivesetName()
public
setName(string $name) : Drive
Parameters
- $name : string
Tags
Return values
DrivesetPermissionExpiration()
Change the Expiration date for the current drive share Set to null to remove the expiration date
public
setPermissionExpiration(string $permissionId, DateTimeImmutable|null $expiration) : bool
Parameters
- $permissionId : string
- $expiration : DateTimeImmutable|null
Tags
Return values
boolsetPermissionRole()
Change the Role of the particular Drive Share.
public
setPermissionRole(string $permissionId, SharingRole $role) : bool
Possible roles are defined by the drive and have to be queried using Drive::getRoles() Roles for shares are not to be confused with the types of share links!
Parameters
- $permissionId : string
- $role : SharingRole
Tags
Return values
boolsetQuota()
public
setQuota(int $quota) : Drive
Parameters
- $quota : int
Tags
Return values
DrivesetReadme()
public
setReadme(string $readme) : Drive
Parameters
- $readme : string
Tags
Return values
DrivetagResource()
public
tagResource(string $path, array<string|int, string> $tags) : void
Parameters
- $path : string
- $tags : array<string|int, string>
Tags
untagResource()
public
untagResource(string $path, array<string|int, string> $tags) : void
Parameters
- $path : string
- $tags : array<string|int, string>
Tags
uploadFile()
Upload the given content to a specific path in the current drive
public
uploadFile(string $path, string $content) : bool
Parameters
- $path : string
- $content : string
Tags
Return values
booluploadFileStream()
Stream the given resource to a specific path in the current drive
public
uploadFileStream(string $path, resource|string|null $resource) : bool
Parameters
- $path : string
- $resource : resource|string|null
-
File resource pointing to the file to be uploaded