Documentation

Ocis
in package

Basic class to establish the connection to an ownCloud Infinite Scale instance

Table of Contents

Methods

__construct()  : mixed
createDrive()  : Drive
Create a new drive (if the user has the permission to do so)
createEducationUser()  : EducationUser
Create a new education user (if the user has the permission to do so)
createGroup()  : Group
Create a new group (if the user has the permission to do so)
deleteGroupByID()  : void
delete an existing group (if the user has the permission to do so)
getAllDrives()  : array<string|int, Drive>
Get all available drives
getDriveById()  : Drive
Retrieve a drive by its unique id
getEducationUserById()  : EducationUser
getEducationUsers()  : array<string|int, EducationUser>
retrieve education users known by the system
getGroupById()  : Group
getGroups()  : array<int, Group>
Get list of groups (if the user has the permission to do so)
getMyDrives()  : array<string|int, Drive>
Get all drives that the current user is a regular member of
getNotifications()  : array<string|int, Notification>
Retrieve all unread notifications of the current user
getOcisVersion()  : string
returns the current oCIS version in semantic versioning format ( e.g. "5.0.5" )
getResourceById()  : OcisResource
getServiceUrl()  : string
getSharedByMe()  : array<string|int, ShareCreated|ShareLink>
getSharedWithMe()  : array<string|int, ShareReceived>
getUserById()  : User
getUsers()  : array<string|int, User>
retrieve users known by the system NOTE: if this function is used by a normal user a search string with at least 3 characters should be provided
isDrivesGetDrivesApi()  : bool
isDrivesRootApi()  : bool
searchResource()  : array<string|int, OcisResource>
Search resource globally or within drive/folder
setAccessToken()  : void
Update the access token. Call this function after refreshing the access token.

Methods

__construct()

public __construct(string $serviceUrl[, string|null $accessToken = null ][, array<string|int, mixed> $connectionConfig = [] ][, string|null $educationAccessToken = null ]) : mixed
Parameters
$serviceUrl : string
$accessToken : string|null = null
$connectionConfig : array<string|int, mixed> = []
$educationAccessToken : string|null = null
Tags
throws
InvalidArgumentException
throws
BadRequestException
throws
ForbiddenException
throws
NotFoundException
throws
UnauthorizedException
throws
HttpException
throws
InvalidResponseException
throws
InternalServerErrorException

createDrive()

Create a new drive (if the user has the permission to do so)

public createDrive(string $name[, int $quota = 0 ][, string|null $description = null ]) : Drive
Parameters
$name : string
$quota : int = 0

in bytes

$description : string|null = null
Tags
throws
BadRequestException
throws
ForbiddenException
throws
NotFoundException
throws
UnauthorizedException
throws
InvalidArgumentException
throws
InvalidResponseException
throws
HttpException
throws
InternalServerErrorException
Return values
Drive

createEducationUser()

Create a new education user (if the user has the permission to do so)

public createEducationUser(string $displayName, string $onPremisesSAMAccountName, string $issuer, string $issuerAssignedId, string $primaryRole[, string|null $surname = null ][, string|null $givenName = null ][, string|null $mail = null ][, EducationUserApi|null $apiInstance = null ]) : EducationUser
Parameters
$displayName : string
$onPremisesSAMAccountName : string
$issuer : string
$issuerAssignedId : string
$primaryRole : string
$surname : string|null = null
$givenName : string|null = null
$mail : string|null = null
$apiInstance : EducationUserApi|null = null
Return values
EducationUser

getAllDrives()

Get all available drives

public getAllDrives([DriveOrder $orderBy = DriveOrder::NAME ][, OrderDirection $orderDirection = OrderDirection::ASC ][, DriveType|null $type = null ]) : array<string|int, Drive>
Parameters
$orderBy : DriveOrder = DriveOrder::NAME
$orderDirection : OrderDirection = OrderDirection::ASC
$type : DriveType|null = null
Tags
throws
BadRequestException
throws
ForbiddenException
throws
NotFoundException
throws
UnauthorizedException
throws
InvalidResponseException
throws
HttpException
throws
InternalServerErrorException
Return values
array<string|int, Drive>

getEducationUsers()

retrieve education users known by the system

public getEducationUsers([array<string|int, string>|null $search = null ][, EducationUserApi|null $apiInstance = null ]) : array<string|int, EducationUser>
Parameters
$search : array<string|int, string>|null = null
$apiInstance : EducationUserApi|null = null
Tags
throws
BadRequestException
throws
ForbiddenException
throws
HttpException
throws
InvalidResponseException
throws
NotFoundException
throws
UnauthorizedException
throws
InternalServerErrorException
Return values
array<string|int, EducationUser>

getGroups()

Get list of groups (if the user has the permission to do so)

public getGroups([string $search = "" ][, OrderDirection $orderBy = OrderDirection::ASC ][, bool $expandMembers = false ]) : array<int, Group>
Parameters
$search : string = ""
$orderBy : OrderDirection = OrderDirection::ASC
$expandMembers : bool = false
Tags
throws
BadRequestException
throws
ForbiddenException
throws
NotFoundException
throws
UnauthorizedException
throws
InvalidArgumentException
throws
InvalidResponseException
throws
HttpException
throws
InternalServerErrorException
Return values
array<int, Group>

getMyDrives()

Get all drives that the current user is a regular member of

public getMyDrives([DriveOrder $orderBy = DriveOrder::NAME ][, OrderDirection $orderDirection = OrderDirection::ASC ][, DriveType|null $type = null ]) : array<string|int, Drive>
Parameters
$orderBy : DriveOrder = DriveOrder::NAME
$orderDirection : OrderDirection = OrderDirection::ASC
$type : DriveType|null = null
Tags
throws
BadRequestException
throws
ForbiddenException
throws
NotFoundException
throws
UnauthorizedException
throws
InvalidResponseException
throws
HttpException
throws
InternalServerErrorException
Return values
array<string|int, Drive>

getOcisVersion()

returns the current oCIS version in semantic versioning format ( e.g. "5.0.5" )

public getOcisVersion() : string
Tags
throws
InvalidResponseException
Return values
string

getServiceUrl()

public getServiceUrl() : string
Return values
string

getUsers()

retrieve users known by the system NOTE: if this function is used by a normal user a search string with at least 3 characters should be provided

public getUsers([string|null $search = null ]) : array<string|int, User>
Parameters
$search : string|null = null
Tags
throws
BadRequestException
throws
ForbiddenException
throws
HttpException
throws
InvalidResponseException
throws
NotFoundException
throws
UnauthorizedException
throws
InternalServerErrorException
Return values
array<string|int, User>

isDrivesGetDrivesApi()

public static isDrivesGetDrivesApi(mixed $api) : bool
Parameters
$api : mixed
Return values
bool

isDrivesRootApi()

public static isDrivesRootApi(mixed $api) : bool
Parameters
$api : mixed
Return values
bool

searchResource()

Search resource globally or within drive/folder

public searchResource(string $pattern[, int|null $limit = null ][, string|null $scopeId = null ]) : array<string|int, OcisResource>
Parameters
$pattern : string

The search pattern where it can be of format:

  • mediatype:<pattern>: Search by media type (e.g., mediatype:*png*).
  • name:*<pattern>: Search by resource name (e.g., name:*der2).
  • <pattern>: General search pattern (e.g., fold*, *der1, subfolder, *fo*). oCIS has huge tests coverage where supported pattern can be found https://github.com/owncloud/ocis
$limit : int|null = null
$scopeId : string|null = null

scopeId could be driveId or folderId

Tags
throws
BadRequestException
throws
ForbiddenException
throws
HttpException
throws
InternalServerErrorException
throws
InvalidResponseException
throws
NotFoundException
throws
ClientException
throws
ClientHttpException
throws
UnauthorizedException
throws
DOMException
Return values
array<string|int, OcisResource>

setAccessToken()

Update the access token. Call this function after refreshing the access token.

public setAccessToken(string $accessToken) : void
Parameters
$accessToken : string
Tags
throws
InvalidArgumentException

        
On this page

Search results