ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilWebDAVLockObject Class Reference

Represents a lock on an ilias object. More...

+ Collaboration diagram for ilWebDAVLockObject:

Public Member Functions

 __construct ($token, $obj_id, $ilias_owner, $dav_owner, $expires, $depth, $type, $scope)
 
 getToken ()
 
 getObjId ()
 
 getIliasOwner ()
 
 getDavOwner ()
 
 getExpires ()
 
 getDepth ()
 
 getType ()
 
 getScope ()
 
 getAsSabreDavLock ($uri)
 

Static Public Member Functions

static createFromAssocArray ($assoc_array)
 
static createFromSabreLock (Sabre\DAV\Locks\LockInfo $lock_info, $obj_id)
 Creates an ILIAS lock object from a sabreDAV lock object. More...
 

Protected Attributes

 $token
 
 $obj_id
 
 $ilias_owner
 
 $dav_owner
 
 $expires
 
 $depth
 
 $type
 
 $scope
 

Detailed Description

Represents a lock on an ilias object.

Objects from this class are immutable!

Author
Raphael Heer rapha.nosp@m.el.h.nosp@m.eer@h.nosp@m.slu..nosp@m.ch $Id$

Definition at line 12 of file class.ilWebDAVLockObject.php.

Constructor & Destructor Documentation

◆ __construct()

ilWebDAVLockObject::__construct (   $token,
  $obj_id,
  $ilias_owner,
  $dav_owner,
  $expires,
  $depth,
  $type,
  $scope 
)
Parameters
string$tokenexample:
int$obj_idexample: 1111
int$ilias_ownerexample: 2222
string$dav_ownerexample: 'Desktop\Raphi'
int$expiresexample: '795596280'
int$depthexample: '-1'
string$typeexample: 'w'
string$scopeexample: 'x'

Definition at line 25 of file class.ilWebDAVLockObject.php.

26 {
27 $this->token = $token;
28 $this->obj_id = $obj_id;
29 $this->ilias_owner = $ilias_owner;
30 $this->dav_owner = $dav_owner;
31 $this->expires = $expires;
32 $this->depth = $depth;
33 $this->type = $type;
34 $this->scope = $scope;
35 }

References $dav_owner, $depth, $expires, $ilias_owner, $obj_id, $scope, $token, and $type.

Member Function Documentation

◆ createFromAssocArray()

static ilWebDAVLockObject::createFromAssocArray (   $assoc_array)
static

Definition at line 110 of file class.ilWebDAVLockObject.php.

111 {
112 return new ilWebDAVLockObject(
113 $assoc_array['token'],
114 $assoc_array['obj_id'],
115 $assoc_array['ilias_owner'],
116 $assoc_array['dav_owner'],
117 $assoc_array['expires'],
118 $assoc_array['depth'],
119 $assoc_array['type'],
120 $assoc_array['scope']
121 );
122 }
Represents a lock on an ilias object.

Referenced by ilWebDAVDBManager\getLockObjectWithObjIdFromDB(), and ilWebDAVDBManager\getLockObjectWithTokenFromDB().

+ Here is the caller graph for this function:

◆ createFromSabreLock()

static ilWebDAVLockObject::createFromSabreLock ( Sabre\DAV\Locks\LockInfo  $lock_info,
  $obj_id 
)
static

Creates an ILIAS lock object from a sabreDAV lock object.

IMPORTANT: This method just creates and initializes an object. It does not create any record in the database!

Parameters
Sabre\DAV\Locks\LockInfo$lock_info

Definition at line 132 of file class.ilWebDAVLockObject.php.

133 {
134 global $DIC;
135
136 $ilias_lock = new ilWebDAVLockObject(
137 $lock_info->token, // token
138 $obj_id, // obj_id
139 $DIC->user()->getId(), // ilias_owner
140 $lock_info->owner, // dav_owner
141 time() + 360, // expires (hard coded like in the old webdav)
142 $lock_info->depth, // depth
143 'w', // type
144 $lock_info->scope
145 ); // scope
146
147 return $ilias_lock;
148 }
global $DIC
Definition: saml.php:7

References $DIC, and $obj_id.

Referenced by ilWebDAVLockBackend\lock().

+ Here is the caller graph for this function:

◆ getAsSabreDavLock()

ilWebDAVLockObject::getAsSabreDavLock (   $uri)

Definition at line 150 of file class.ilWebDAVLockObject.php.

151 {
152 global $DIC;
153
154 $timestamp = time();
155
156 $sabre_lock = new Sabre\DAV\Locks\LockInfo();
157 $sabre_lock->created;
158 $sabre_lock->depth = $this->depth;
159 $sabre_lock->owner = $this->dav_owner;
160 $sabre_lock->scope = $this->scope;
161 $sabre_lock->timeout = $this->expires - $timestamp;
162 $sabre_lock->created = $this->expires - 3600;
163 $sabre_lock->token = $this->token;
164 $sabre_lock->uri = $uri;
165
166 return $sabre_lock;
167 }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
LockInfo class.
Definition: LockInfo.php:15

References $dav_owner, $depth, $DIC, $scope, $timestamp, and $token.

◆ getDavOwner()

ilWebDAVLockObject::getDavOwner ( )
Returns
string

Definition at line 73 of file class.ilWebDAVLockObject.php.

74 {
75 return $this->dav_owner;
76 }

References $dav_owner.

Referenced by ilWebDAVDBManager\saveLockToDB().

+ Here is the caller graph for this function:

◆ getDepth()

ilWebDAVLockObject::getDepth ( )
Returns
int

Definition at line 89 of file class.ilWebDAVLockObject.php.

90 {
91 return $this->depth;
92 }

References $depth.

Referenced by ilWebDAVDBManager\saveLockToDB().

+ Here is the caller graph for this function:

◆ getExpires()

ilWebDAVLockObject::getExpires ( )
Returns
int

Definition at line 81 of file class.ilWebDAVLockObject.php.

82 {
83 return $this->expires;
84 }

References $expires.

Referenced by ilWebDAVDBManager\saveLockToDB().

+ Here is the caller graph for this function:

◆ getIliasOwner()

ilWebDAVLockObject::getIliasOwner ( )
Returns
int

Definition at line 65 of file class.ilWebDAVLockObject.php.

66 {
67 return $this->ilias_owner;
68 }

References $ilias_owner.

Referenced by ilWebDAVDBManager\saveLockToDB().

+ Here is the caller graph for this function:

◆ getObjId()

ilWebDAVLockObject::getObjId ( )
Returns
int

Definition at line 57 of file class.ilWebDAVLockObject.php.

58 {
59 return $this->obj_id;
60 }

References $obj_id.

Referenced by ilWebDAVDBManager\saveLockToDB().

+ Here is the caller graph for this function:

◆ getScope()

ilWebDAVLockObject::getScope ( )
Returns
string

Definition at line 105 of file class.ilWebDAVLockObject.php.

106 {
107 return $this->scope;
108 }

References $scope.

Referenced by ilWebDAVDBManager\saveLockToDB().

+ Here is the caller graph for this function:

◆ getToken()

ilWebDAVLockObject::getToken ( )
Returns
string

Definition at line 49 of file class.ilWebDAVLockObject.php.

50 {
51 return $this->token;
52 }

References $token.

Referenced by ilWebDAVDBManager\saveLockToDB().

+ Here is the caller graph for this function:

◆ getType()

ilWebDAVLockObject::getType ( )
Returns
string

Definition at line 97 of file class.ilWebDAVLockObject.php.

98 {
99 return $this->type;
100 }

References $type.

Referenced by ilWebDAVDBManager\saveLockToDB().

+ Here is the caller graph for this function:

Field Documentation

◆ $dav_owner

ilWebDAVLockObject::$dav_owner
protected

Definition at line 40 of file class.ilWebDAVLockObject.php.

Referenced by __construct(), getAsSabreDavLock(), and getDavOwner().

◆ $depth

ilWebDAVLockObject::$depth
protected

Definition at line 42 of file class.ilWebDAVLockObject.php.

Referenced by __construct(), getAsSabreDavLock(), and getDepth().

◆ $expires

ilWebDAVLockObject::$expires
protected

Definition at line 41 of file class.ilWebDAVLockObject.php.

Referenced by __construct(), and getExpires().

◆ $ilias_owner

ilWebDAVLockObject::$ilias_owner
protected

Definition at line 39 of file class.ilWebDAVLockObject.php.

Referenced by __construct(), and getIliasOwner().

◆ $obj_id

ilWebDAVLockObject::$obj_id
protected

Definition at line 38 of file class.ilWebDAVLockObject.php.

Referenced by __construct(), createFromSabreLock(), and getObjId().

◆ $scope

ilWebDAVLockObject::$scope
protected

Definition at line 44 of file class.ilWebDAVLockObject.php.

Referenced by __construct(), getAsSabreDavLock(), and getScope().

◆ $token

ilWebDAVLockObject::$token
protected

Definition at line 37 of file class.ilWebDAVLockObject.php.

Referenced by __construct(), getAsSabreDavLock(), and getToken().

◆ $type

ilWebDAVLockObject::$type
protected

Definition at line 43 of file class.ilWebDAVLockObject.php.

Referenced by __construct(), and getType().


The documentation for this class was generated from the following file: