wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
class.Lock.php
Go to the documentation of this file.
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2014 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of any of the following licenses
7  * at your choice:
8  *
9  * - GNU Lesser General Public License (LGPL)
10  * http://www.gnu.org/licenses/lgpl.html
11  * - Eclipse Public License (EPL)
12  * http://www.eclipse.org/org/documents/epl-v10.php
13  *
14  * See the license.txt file distributed with this work for
15  * additional information.
16  *
17  * $Id: class.Lock.php 1462 2014-02-04 23:52:27Z iherwig $
18  */
19 
20 /**
21  * @class Lock
22  * @ingroup Persistence
23  * @brief Lock represents a lock on an object.
24  *
25  * @author ingo herwig <ingo@wemove.com>
26  */
27 class Lock
28 {
29  var $_oid = "";
30  var $_useroid = "";
31  var $_login = "";
32  var $_sessid = "";
33  var $_created = "";
34 
35  /**
36  * Creates a lock on a given object.
37  * @param oid The oid of the object to lock
38  * @param useroid The oid of the user who holds the lock
39  * @param login The login of the user who holds the lock
40  * @param sessid The id of the session of the user
41  * @param created The creation date of the lock. If omitted the current date will be taken.
42  */
43  function Lock($oid, $useroid, $login, $sessid, $created='')
44  {
45  $this->_oid = $oid;
46  $this->_useroid = $useroid;
47  $this->_login = $login;
48  $this->_sessid = $sessid;
49  if ($created == '')
50  $this->_created = date("Y-m-d H:i:s");
51  else
52  $this->_created = $created;
53  }
54 
55  /**
56  * Get the oid of the locked object.
57  * @return The oid of the locked object.
58  */
59  function getOID()
60  {
61  return $this->_oid;
62  }
63 
64  /**
65  * Get the oid of the user who holds the lock.
66  * @return The oid of the user.
67  */
68  function getUserOID()
69  {
70  return $this->_useroid;
71  }
72 
73  /**
74  * Get the login of the user who holds the lock.
75  * @return The login of the user.
76  */
77  function getLogin()
78  {
79  return $this->_login;
80  }
81 
82  /**
83  * Get the session id of the user who holds the lock.
84  * @return The session id of the user.
85  */
86  function getSessionID()
87  {
88  return $this->_sessid;
89  }
90 
91  /**
92  * Get the creation date/time of the lock.
93  * @return The creation date/time of the lock.
94  */
95  function getCreated()
96  {
97  return $this->_created;
98  }
99 }
100 ?>
$_sessid
Definition: class.Lock.php:32
$_useroid
Definition: class.Lock.php:30
getSessionID()
Definition: class.Lock.php:86
getLogin()
Definition: class.Lock.php:77
Lock($oid, $useroid, $login, $sessid, $created='')
Definition: class.Lock.php:43
getCreated()
Definition: class.Lock.php:95
$_created
Definition: class.Lock.php:33
getOID()
Definition: class.Lock.php:59
Lock represents a lock on an object.
Definition: class.Lock.php:27
getUserOID()
Definition: class.Lock.php:68