Constructs a new locking manager object
When the CREATE_TABLES attribute of the connection on which the manager is supposed to work on is set to true, the locking table is created.
Parameters:
API Tags:
Obtains a lock on a Doctrine_Record
Parameters:
Doctrine_Record |
$record: |
The record that has to be locked |
mixed |
$userIdent: |
A unique identifier of the locking user |
API Tags:
Return: | TRUE if the locking was successful, FALSE if another user holds a lock on this record |
Access: | public |
Information Tags:
Throws: | Doctrine_Locking_Exception If the locking failed due to database errors |
Gets the identifier that identifies the owner of the lock on the given record.
Parameters:
API Tags:
Return: | The unique user identifier that identifies the owner of the lock. |
Access: | public |
integer releaseAgedLocks(
[integer
$age = 900], [string
$objectType = null], [mixed
$userIdent = null]
)
|
|
Releases locks older than a defined amount of seconds
When called without parameters all locks older than 15 minutes are released.
Parameters:
integer |
$age: |
The maximum valid age of locks in seconds |
string |
$objectType: |
The type of the object (component name) |
mixed |
$userIdent: |
The unique identifier of the locking user |
API Tags:
Return: | The number of locks that have been released |
Access: | public |
Information Tags:
Throws: | Doctrine_Locking_Exception If the release process failed due to database errors |
Releases a lock on a Doctrine_Record
Parameters:
Doctrine_Record |
$record: |
The record for which the lock has to be released |
mixed |
$userIdent: |
The unique identifier of the locking user |
API Tags:
Return: | TRUE if a lock was released, FALSE if no lock was released |
Access: | public |
Information Tags:
Throws: | Doctrine_Locking_Exception If the release procedure failed due to database errors |
mixed _getLockingUserIdent(
string
$objectType, mixed
$key
)
|
|
Gets the unique user identifier of a lock
Parameters:
string |
$objectType: |
The type of the object (component name) |
mixed |
$key: |
The unique key of the object |
API Tags:
Return: | The unique user identifier for the specified lock |
Access: | private |
Information Tags:
Throws: | Doctrine_Locking_Exception If the query failed due to database errors |