Toggle navigation
wCMF 4.0
Guides
Getting started
Architecture
Model
Persistence
Presentation
Configuration
Security
I18n & l10n
Tests
API
Code
Support
wcmf_older
wcmf
src
wcmf
lib
persistence
concurrency
OptimisticLockException.php
1
<?php
2
/**
3
* wCMF - wemove Content Management Framework
4
* Copyright (C) 2005-2015 wemove digital solutions GmbH
5
*
6
* Licensed under the terms of the MIT License.
7
*
8
* See the LICENSE file distributed with this work for
9
* additional information.
10
*/
11
namespace
wcmf\lib\persistence\concurrency
;
12
13
/**
14
* OptimisticLockException signals an exception when trying to create an
15
* optimistic lock.
16
*
17
* @author ingo herwig <ingo@wemove.com>
18
*/
19
class
OptimisticLockException
extends
\Exception {
20
21
private
$_currentState = null;
22
23
/**
24
* Constructor
25
* @param $currentState PersistentObject instance representing the current object state
26
* or null, if the object is deleted
27
*/
28
public
function
__construct
($currentState) {
29
$this->_currentState = $currentState;
30
31
$msg =
''
;
32
if
($currentState == null) {
33
$msg =
'The object was deleted by another user.'
;
34
}
35
else
{
36
$msg =
'The object was modified by another user.'
;
37
}
38
parent::__construct($msg);
39
}
40
41
/**
42
* Get the current object
43
* @return PersistentObject instance
44
*/
45
public
function
getCurrentState
() {
46
return
$this->_currentState;
47
}
48
}
49
?>
wcmf\lib\persistence\concurrency
Definition:
namespaces.php:46
wcmf\lib\persistence\concurrency\OptimisticLockException
OptimisticLockException signals an exception when trying to create an optimistic lock.
Definition:
OptimisticLockException.php:19
wcmf\lib\persistence\concurrency\OptimisticLockException\getCurrentState
getCurrentState()
Get the current object.
Definition:
OptimisticLockException.php:45
wcmf\lib\persistence\concurrency\OptimisticLockException\__construct
__construct($currentState)
Constructor.
Definition:
OptimisticLockException.php:28