LockHandler Interface Reference

Detailed Description

LockHandler defines the interface for LockHandler implementations.

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

Definition at line 21 of file LockHandler.php.

+ Inheritance diagram for LockHandler:

Public Member Functions

 aquireLock (ObjectId $oid, $type, PersistentObject $currentState=null)
 
 releaseLock (ObjectId $oid, $type=null)
 
 releaseLocks (ObjectId $oid)
 
 releaseAllLocks ()
 
 getLock (ObjectId $oid)
 
 updateLock (ObjectId $oid, PersistentObject $object)
 

Member Function Documentation

aquireLock ( ObjectId  $oid,
  $type,
PersistentObject  $currentState = null 
)

Aquire a lock on an object id for the current user and throw an exception, if another user already owns a pessimistic lock on the object.

Parameters
$oidObjectId of the object to lock.
$typeOne of the Lock::Type constants.
$currentStatePersistentObject instance defining the current state for an optimistic lock (optional, only given if type is Lock::TYPE_OPTIMISTIC)

Implemented in DefaultLockHandler, and NullLockHandler.

releaseLock ( ObjectId  $oid,
  $type = null 
)

Release the lock the current user owns on an object id.

Parameters
$oidObjectId of the object to release.
$typeOne of the Lock::Type constants or null for all types (default: null)

Implemented in DefaultLockHandler, and NullLockHandler.

releaseLocks ( ObjectId  $oid)

Release all locks on an object id regardless of the user.

Parameters
$oidObjectId of the object to release.

Implemented in DefaultLockHandler, and NullLockHandler.

releaseAllLocks ( )

Release all locks owned by the current user.

Implemented in DefaultLockHandler, and NullLockHandler.

getLock ( ObjectId  $oid)

Get the lock for an object id.

Parameters
$oidobject id of the object to get the lock data for.
Returns
Lock instance or null

Implemented in DefaultLockHandler, and NullLockHandler.

updateLock ( ObjectId  $oid,
PersistentObject  $object 
)

Update the current state of the lock belonging to the given object if existing and owned by the current.

Parameters
$oidThe object id.
$objectThe updated object data.

Implemented in DefaultLockHandler, and NullLockHandler.