CMS Made Simple API

CmsLockOperations
in package

FinalYes

A singleton class providing utilities for interacting with locks.

Tags
licsense

GPL

since
2.0

Table of Contents

Methods

delete()  : mixed
Delete any lock of the specified type, and id that matches the currently logged in UID
delete_for_user()  : mixed
Delete all the locks for the current user
get_locks()  : mixed
Get all locks of a specific type
is_locked()  : bool
test for any lock of the specified type, and id
touch()  : int
Touch any lock of the specified type, and id that matches the currently logged in UID
unlock()  : mixed
Delete any lock of the specified type, and id that matches the currently logged in UID
delete_expired()  : mixed
Delete any locks that have expired.

Methods

delete()

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

public static delete(int $lock_id, string $type, int $oid) : mixed
Parameters
$lock_id : int

The lock identifier

$type : string

The type of object being locked

$oid : int

The object identifier

delete_for_user()

Delete all the locks for the current user

public static delete_for_user([string $type = null ]) : mixed
Parameters
$type : string = null

An optional type name.

get_locks()

Get all locks of a specific type

public static get_locks(string $type) : mixed
Parameters
$type : string

The lock type

is_locked()

test for any lock of the specified type, and id

public static is_locked(string $type, int $oid) : bool
Parameters
$type : string

The type of object being locked

$oid : int

The object identifier

Return values
bool

touch()

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

public static touch(int $lock_id, string $type, int $oid) : int
Parameters
$lock_id : int

The lock identifier

$type : string

The type of object being locked

$oid : int

The object identifier

Return values
int

The expiry timestamp of the lock.

unlock()

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

public static unlock(int $lock_id, string $type, int $oid) : mixed
Parameters
$lock_id : int

The lock identifier

$type : string

The type of object being locked

$oid : int

The object identifier

delete_expired()

Delete any locks that have expired.

private static delete_expired([int $expires = null ][, string $type = null ]) : mixed
Parameters
$expires : int = null

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

$type : string = null

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


        
On this page

Search results