Nextcloud PHP API (master)

ILock

Tags
since
24.0.0

Table of Contents

Constants

LOCK_DEPTH_INFINITE  = -1
Lock app resources under the locked one with infinite depth
LOCK_DEPTH_ZERO  = 0
Lock only the resource the lock is applied to
LOCK_EXCLUSIVE  = 1
WebDAV Lock scope exclusive
LOCK_SHARED  = 2
WebDAV Lock scope shared
TYPE_APP  = 1
App owned lock
TYPE_TOKEN  = 2
Token owned lock
TYPE_USER  = 0
User owned manual lock

Methods

__toString()  : string
String representation of the lock to identify it through logging
getCreatedAt()  : int
Unix timestamp of the lock creation time
getDepth()  : int
Lock depth to apply the lock to child resources
getFileId()  : int
File id that the lock is holding
getOwner()  : string
Owner that holds the lock
getScope()  : int
WebDAV lock scope
getTimeout()  : int
Timeout of the lock in seconds starting from the created at time
getToken()  : string
Token string as a unique identifier for the lock, usually a UUID
getType()  : int
Type of the lock

Constants

LOCK_DEPTH_INFINITE

Lock app resources under the locked one with infinite depth

public mixed LOCK_DEPTH_INFINITE = -1
Tags
since
24.0.0

LOCK_DEPTH_ZERO

Lock only the resource the lock is applied to

public mixed LOCK_DEPTH_ZERO = 0
Tags
since
24.0.0

LOCK_EXCLUSIVE

WebDAV Lock scope exclusive

public mixed LOCK_EXCLUSIVE = 1
Tags
since
24.0.0

LOCK_SHARED

WebDAV Lock scope shared

public mixed LOCK_SHARED = 2
Tags
since
24.0.0

TYPE_APP

App owned lock

public mixed TYPE_APP = 1

This lock type is created by collaborative apps like Text or Office to avoid outside changes through WevDAV or other apps.

Tags
since
24.0.0

TYPE_TOKEN

Token owned lock

public mixed TYPE_TOKEN = 2

This lock type will bind the ownership to the provided lock token. Any request that aims to modify the file will be required to sent the token, the user itself is not able to write to files without the token. This will allow to limit the locking to an individual client.

Tags
since
24.0.0

TYPE_USER

User owned manual lock

public mixed TYPE_USER = 0

This lock type is initiated by a user manually through the web UI or clients and will limit editing capabilities on the file to the lock owning user.

Tags
since
24.0.0

Methods

__toString()

String representation of the lock to identify it through logging

public __toString() : string
Tags
since
24.0.0
Return values
string

getCreatedAt()

Unix timestamp of the lock creation time

public getCreatedAt() : int
Tags
since
24.0.0
Return values
int

getDepth()

Lock depth to apply the lock to child resources

public getDepth() : int
Tags
since
24.0.0
Return values
int

getFileId()

File id that the lock is holding

public getFileId() : int
Tags
since
24.0.0
Return values
int

getOwner()

Owner that holds the lock

public getOwner() : string

Depending on the lock type this is:

  • ILock::TYPE_USER: A user id
  • ILock::TYPE_APP: An app id
  • ILock::TYPE_TOKEN: A user id
Tags
since
24.0.0
Return values
string

getScope()

WebDAV lock scope

public getScope() : int
Tags
since
24.0.0
psalm-return

ILock::LOCK_EXCLUSIVE|ILock::LOCK_SHARED

Return values
int

getTimeout()

Timeout of the lock in seconds starting from the created at time

public getTimeout() : int
Tags
since
24.0.0
Return values
int

getToken()

Token string as a unique identifier for the lock, usually a UUID

public getToken() : string
Tags
since
24.0.0
Return values
string

getType()

Type of the lock

public getType() : int
Tags
psalm-return

ILock::TYPE_*

since
24.0.0
Return values
int

        
On this page

Search results