Detailed Description

Lock represents a lock on an object.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 18 of file Lock.php.

+ Inheritance diagram for Lock:

Public Member Functions

 __construct ($type, $oid, $login, $created='')
 
 getType ()
 
 getObjectId ()
 
 getLogin ()
 
 getCreated ()
 
 setCurrentState ($currentState)
 
 getCurrentState ()
 
 serialize ()
 
 unserialize ($data)
 

Public Attributes

const TYPE_OPTIMISTIC = 'optimistic'
 
const TYPE_PESSIMISTIC = 'pessimistic'
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $type,
  $oid,
  $login,
  $created = '' 
)

Creates a lock on a given object.

Parameters
$typeOne of the Lock::Type constants
$oidObjectId of the object to lock
$loginLogin name of the user who holds the lock
$createdCreation date of the lock. If omitted the current date will be taken.

Definition at line 36 of file Lock.php.

Member Function Documentation

◆ getType()

getType ( )

Get the type of the lock.

Returns
One of the Lock::Type constants.

Definition at line 52 of file Lock.php.

◆ getObjectId()

getObjectId ( )

Get the oid of the locked object.

Returns
ObjectId of the locked object.

Definition at line 60 of file Lock.php.

◆ getLogin()

getLogin ( )

Get the login of the user who holds the lock.

Returns
The login of the user.

Definition at line 68 of file Lock.php.

◆ getCreated()

getCreated ( )

Get the creation date/time of the lock.

Returns
The creation date/time of the lock.

Definition at line 76 of file Lock.php.

◆ setCurrentState()

setCurrentState (   $currentState)

Set the original state of the object in case of an optimistic lock.

Parameters
$currentStatePersistentObject instance or null

Definition at line 85 of file Lock.php.

◆ getCurrentState()

getCurrentState ( )

Get the original state of the object in case of an optimistic lock.

Returns
PersistentObject instance or null

Definition at line 94 of file Lock.php.

◆ serialize()

serialize ( )

Definition at line 98 of file Lock.php.

◆ unserialize()

unserialize (   $data)

Definition at line 103 of file Lock.php.

Member Data Documentation

◆ TYPE_OPTIMISTIC

const TYPE_OPTIMISTIC = 'optimistic'

Definition at line 20 of file Lock.php.

◆ TYPE_PESSIMISTIC

const TYPE_PESSIMISTIC = 'pessimistic'

Definition at line 21 of file Lock.php.