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.
◆ __construct()
__construct |
( |
|
$type, |
|
|
|
$oid, |
|
|
|
$login, |
|
|
|
$created = '' |
|
) |
| |
Creates a lock on a given object.
- Parameters
-
$type | One of the Lock::Type constants |
$oid | ObjectId of the object to lock |
$login | Login name of the user who holds the lock |
$created | Creation date of the lock. If omitted the current date will be taken. |
Definition at line 36 of file Lock.php.
◆ getType()
Get the type of the lock.
- Returns
- One of the Lock::Type constants.
Definition at line 52 of file Lock.php.
◆ getObjectId()
Get the oid of the locked object.
- Returns
- ObjectId of the locked object.
Definition at line 60 of file Lock.php.
◆ 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()
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
-
Definition at line 85 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 94 of file Lock.php.
◆ serialize()
◆ unserialize()
◆ TYPE_OPTIMISTIC
const TYPE_OPTIMISTIC = 'optimistic' |
◆ TYPE_PESSIMISTIC
const TYPE_PESSIMISTIC = 'pessimistic' |