CmsLockOperations View code

A singleton class providing utilities for interacting with locks.

package

CMS

licsense

GPL

since 2.0

Methods

touch(integer $lock_id, string $type, integer $oid) : integer

Touch any lock of the specified type, and id that matches the currently logged in UID

static

Arguments

integer $lock_id

The lock identifier

string $type

The type of object being locked

integer $oid

The object identifier

Response

integer

The expiry timestamp of the lock.

delete(integer $lock_id, string $type, integer $oid) 

Delete any lock of the specified type, and id that matches the currently logged in UID

static

Arguments

integer $lock_id

The lock identifier

string $type

The type of object being locked

integer $oid

The object identifier

unlock(integer $lock_id, string $type, integer $oid) 

Delete any lock of the specified type, and id that matches the currently logged in UID

static

Arguments

integer $lock_id

The lock identifier

string $type

The type of object being locked

integer $oid

The object identifier

is_locked(string $type, integer $oid) : boolean

test for any lock of the specified type, and id

static

Arguments

string $type

The type of object being locked

integer $oid

The object identifier

Response

boolean

delete_expired(integer $expires = null, string $type = null) 

Delete any locks that have expired.

static

Arguments

integer $expires

Delete locks older than this date (if not specified current time will be used).

string $type

The type of locks to delete. If not specified any locks can be deleted.

get_locks(string $type) 

Get all locks of a specific type

static

Arguments

string $type

The lock type

delete_for_user(string $type = null) 

Delete all the locks for the current user

static

Arguments

string $type

An optional type name.