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.

Public Member Functions

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

Public Attributes

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

Constructor & Destructor Documentation

__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 35 of file Lock.php.

Member Function Documentation

getType ( )

Get the type of the lock.

Returns
One of the Lock::Type constants.

Definition at line 51 of file Lock.php.

getObjectId ( )

Get the oid of the locked object.

Returns
ObjectId of the locked object.

Definition at line 59 of file Lock.php.

getLogin ( )

Get the login of the user who holds the lock.

Returns
The login of the user.

Definition at line 67 of file Lock.php.

getCreated ( )

Get the creation date/time of the lock.

Returns
The creation date/time of the lock.

Definition at line 75 of file Lock.php.

setCurrentState (   $currentState)

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

Parameters
$currentStatePersistentObject instance or null

Definition at line 84 of file Lock.php.

getCurrentState ( )

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

Returns
PersistentObject instance or null

Definition at line 93 of file Lock.php.

Member Data Documentation

const TYPE_OPTIMISTIC = 'optimistic'

Definition at line 20 of file Lock.php.

const TYPE_PESSIMISTIC = 'pessimistic'

Definition at line 21 of file Lock.php.