CMS Made Simple API

CmsLock
in package
implements ArrayAccess

FinalYes

A simple class represeinting a lock on a logical object in CMSMS.

Tags
author

Robert Campbell (calguy1000@cmsmadesimple.org)

since
2.0
param-read

int $id

param-read

int $created (unixtime)

param-read

int $modified (unixtime)

param-read

int $lifetime (minutes)

param-read

int $expires (unixtime)

Table of Contents

Interfaces

ArrayAccess

Methods

__construct()  : mixed
Constructor
delete()  : void
Delete the current lock from the database.
expired()  : bool
Test if the current lock object has expired
load()  : CmsLock
Load a lock based on type and object id.
load_by_id()  : CmsLock
Create a lock object given it's id, type, and object id
save()  : void
Save the current lock object

Methods

__construct()

Constructor

public __construct(string $type, int $oid[, int $lifetime = null ]) : mixed
Parameters
$type : string
$oid : int

Object Id

$lifetime : int = null

(in minutes) The lifetime of the lock before it can be stolen. If not specified, the system default value will be used.

Tags
throws
CmsInvalidDataException

delete()

Delete the current lock from the database.

public delete() : void
Tags
throws
Exception

expired()

Test if the current lock object has expired

public expired() : bool
Return values
bool

load()

Load a lock based on type and object id.

public static & load(string $type, int $oid[, int $uid = null ]) : CmsLock
Parameters
$type : string

The lock type (type of object being locked)

$oid : int

The object id

$uid : int = null

An optional user identifier.

Tags
throws
CmsInvalidDataException
throws
CmsNoLockException
throws
Exception
Return values
CmsLock

load_by_id()

Create a lock object given it's id, type, and object id

public static & load_by_id(int $lock_id, string $type, int $oid[, int $uid = NULL ]) : CmsLock
Parameters
$lock_id : int
$type : string

The lock type (type of object being locked)

$oid : int

The object id

$uid : int = NULL

An optional user identifier.

Tags
throws
CmsInvalidDataException
throws
CmsNoLockException
Return values
CmsLock

save()

Save the current lock object

public save() : void
Tags
throws
CmsSqlErrorException
throws
Exception

        
On this page

Search results