Detailed Description
LockHandler defines the interface for LockHandler implementations.
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()
| 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
-
$oid ObjectId of the object to lock. $type One of the Lock::Type constants. $currentState PersistentObject instance defining the current state for an optimistic lock (optional, only given if type is Lock::TYPE_OPTIMISTIC)
Implemented in DefaultLockHandler, and NullLockHandler.
◆ releaseLock()
| releaseLock | ( | ObjectId | $oid, |
$type = null |
|||
| ) |
Release the lock the current user owns on an object id.
- Parameters
-
$oid ObjectId of the object to release. $type One of the Lock::Type constants or null for all types (default: null)
Implemented in DefaultLockHandler, and NullLockHandler.
◆ releaseLocks()
| releaseLocks | ( | ObjectId | $oid | ) |
Release all locks on an object id regardless of the user.
- Parameters
-
$oid ObjectId of the object to release.
Implemented in DefaultLockHandler, and NullLockHandler.
◆ releaseAllLocks()
| releaseAllLocks | ( | ) |
Release all locks owned by the current user.
Implemented in DefaultLockHandler, and NullLockHandler.
◆ getLock()
| getLock | ( | ObjectId | $oid | ) |
Get the lock for an object id.
- Parameters
-
$oid object id of the object to get the lock data for.
- Returns
- Lock instance or null
Implemented in DefaultLockHandler, and NullLockHandler.
◆ updateLock()
| 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
-
$oid The object id. $object The updated object data.
Implemented in DefaultLockHandler, and NullLockHandler.