PessimisticLockException.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2020 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  */
12 
14 
15 /**
16  * PessimisticLockException signals an exception when trying to create an
17  * pessimistic lock.
18  *
19  * @author ingo herwig <ingo@wemove.com>
20  */
21 class PessimisticLockException extends \Exception {
22 
23  private $lock = null;
24 
25  /**
26  * Constructor
27  * @param $lock Lock instance that cause the exception
28  */
29  public function __construct(Lock $lock) {
30  $this->lock = $lock;
31 
32  parent::__construct("The object is currently locked by another user.");
33  }
34 
35  /**
36  * Get the lock
37  * @return Lock instance
38  */
39  public function getLock() {
40  return $this->lock;
41  }
42 }
43 ?>
PessimisticLockException signals an exception when trying to create an pessimistic lock.
Lock represents a lock on an object.
Definition: Lock.php:18