Detailed Description
DefaultLockHandler implements the LockHandler interface for relational databases.
It relies on an entity type that implements the PersistentLock interface.
Definition at line 32 of file DefaultLockHandler.php.
Public Member Functions | |
__construct (PersistenceFacade $persistenceFacade, Session $session, $lockType) | |
aquireLock (ObjectId $oid, $type, PersistentObject $currentState=null) | |
releaseLock (ObjectId $oid, $type=null) | |
releaseLocks (ObjectId $oid) | |
releaseAllLocks () | |
getLock (ObjectId $oid) | |
updateLock (ObjectId $oid, PersistentObject $object) | |
Public Attributes | |
const | SESSION_VARNAME = 'DefaultLockHandler.locks' |
Protected Member Functions | |
storeLock (Lock $lock) | |
getAuthUser () | |
getSessionLocks () | |
addSessionLock (Lock $lock) | |
removeSessionLock (ObjectId $oid, $type) | |
removeSessonLocks () | |
Constructor & Destructor Documentation
◆ __construct()
__construct | ( | PersistenceFacade | $persistenceFacade, |
Session | $session, | ||
$lockType | |||
) |
Constructor.
- Parameters
-
$persistenceFacade $session $lockType Entity type name of PersistentLock instances
Definition at line 48 of file DefaultLockHandler.php.
Member Function Documentation
◆ aquireLock()
aquireLock | ( | ObjectId | $oid, |
$type, | |||
PersistentObject | $currentState = null |
||
) |
- See also
- LockHandler::aquireLock()
Implements LockHandler.
Definition at line 62 of file DefaultLockHandler.php.
◆ releaseLock()
releaseLock | ( | ObjectId | $oid, |
$type = null |
|||
) |
- See also
- LockHandler::releaseLock()
Implements LockHandler.
Definition at line 97 of file DefaultLockHandler.php.
◆ releaseLocks()
releaseLocks | ( | ObjectId | $oid | ) |
- See also
- LockHandler::releaseLocks()
Implements LockHandler.
Definition at line 116 of file DefaultLockHandler.php.
◆ releaseAllLocks()
releaseAllLocks | ( | ) |
- See also
- LockHandler::releaseAllLocks()
Implements LockHandler.
Definition at line 132 of file DefaultLockHandler.php.
◆ getLock()
getLock | ( | ObjectId | $oid | ) |
- See also
- LockHandler::getLock()
Implements LockHandler.
Definition at line 151 of file DefaultLockHandler.php.
◆ updateLock()
updateLock | ( | ObjectId | $oid, |
PersistentObject | $object | ||
) |
- See also
- LockHandler::updateLock()
Implements LockHandler.
Definition at line 192 of file DefaultLockHandler.php.
◆ storeLock()
|
protected |
Store the given Lock instance for later retrieval.
- Parameters
-
$lock Lock instance
Definition at line 209 of file DefaultLockHandler.php.
◆ getAuthUser()
|
protected |
Get the login of the current user.
- Returns
- String
Definition at line 228 of file DefaultLockHandler.php.
◆ getSessionLocks()
|
protected |
Get the Lock instances stored in the session.
- Returns
- Associative array with the serialized ObjectId instances as keys and the Lock instances as values
Definition at line 237 of file DefaultLockHandler.php.
◆ addSessionLock()
|
protected |
Add a given Lock instance to the session.
- Parameters
-
$lock Lock instance
Definition at line 248 of file DefaultLockHandler.php.
◆ removeSessionLock()
|
protected |
Remove a given Lock instance from the session.
- Parameters
-
$oid The locked oid $type One of the Lock::Type constants or null for all types (default: null)
Definition at line 259 of file DefaultLockHandler.php.
◆ removeSessonLocks()
|
protected |
Remove all Lock instances from the session.
Definition at line 273 of file DefaultLockHandler.php.
Member Data Documentation
◆ SESSION_VARNAME
const SESSION_VARNAME = 'DefaultLockHandler.locks' |
Definition at line 34 of file DefaultLockHandler.php.