ILIAS  release_7 Revision v7.30-3-g800a261c036
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 10 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 23 of file class.ilWebDAVLockObject.php.

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

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 108 of file class.ilWebDAVLockObject.php.

109 {
110 return new ilWebDAVLockObject(
111 $assoc_array['token'],
112 $assoc_array['obj_id'],
113 $assoc_array['ilias_owner'],
114 $assoc_array['dav_owner'],
115 $assoc_array['expires'],
116 $assoc_array['depth'],
117 $assoc_array['type'],
118 $assoc_array['scope']
119 );
120 }
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 130 of file class.ilWebDAVLockObject.php.

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

References $DIC, and $obj_id.

Referenced by ilWebDAVLockBackend\lock().

+ Here is the caller graph for this function:

◆ getAsSabreDavLock()

ilWebDAVLockObject::getAsSabreDavLock (   $uri)

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

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

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

◆ getDavOwner()

ilWebDAVLockObject::getDavOwner ( )
Returns
string

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

72 {
73 return $this->dav_owner;
74 }

References $dav_owner.

Referenced by ilWebDAVDBManager\saveLockToDB().

+ Here is the caller graph for this function:

◆ getDepth()

ilWebDAVLockObject::getDepth ( )
Returns
int

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

88 {
89 return $this->depth;
90 }

References $depth.

Referenced by ilWebDAVDBManager\saveLockToDB().

+ Here is the caller graph for this function:

◆ getExpires()

ilWebDAVLockObject::getExpires ( )
Returns
int

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

80 {
81 return $this->expires;
82 }

References $expires.

Referenced by ilWebDAVDBManager\saveLockToDB().

+ Here is the caller graph for this function:

◆ getIliasOwner()

ilWebDAVLockObject::getIliasOwner ( )
Returns
int

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

64 {
65 return $this->ilias_owner;
66 }

References $ilias_owner.

Referenced by ilWebDAVDBManager\saveLockToDB().

+ Here is the caller graph for this function:

◆ getObjId()

ilWebDAVLockObject::getObjId ( )
Returns
int

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

56 {
57 return $this->obj_id;
58 }

References $obj_id.

Referenced by ilWebDAVDBManager\saveLockToDB().

+ Here is the caller graph for this function:

◆ getScope()

ilWebDAVLockObject::getScope ( )
Returns
string

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

104 {
105 return $this->scope;
106 }

References $scope.

Referenced by ilWebDAVDBManager\saveLockToDB().

+ Here is the caller graph for this function:

◆ getToken()

ilWebDAVLockObject::getToken ( )
Returns
string

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

48 {
49 return $this->token;
50 }

References $token.

Referenced by ilWebDAVDBManager\saveLockToDB().

+ Here is the caller graph for this function:

◆ getType()

ilWebDAVLockObject::getType ( )
Returns
string

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

96 {
97 return $this->type;
98 }

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 38 of file class.ilWebDAVLockObject.php.

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

◆ $depth

ilWebDAVLockObject::$depth
protected

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

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

◆ $expires

ilWebDAVLockObject::$expires
protected

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

Referenced by __construct(), and getExpires().

◆ $ilias_owner

ilWebDAVLockObject::$ilias_owner
protected

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

Referenced by __construct(), and getIliasOwner().

◆ $obj_id

ilWebDAVLockObject::$obj_id
protected

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

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

◆ $scope

ilWebDAVLockObject::$scope
protected

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

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

◆ $token

ilWebDAVLockObject::$token
protected

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

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

◆ $type

ilWebDAVLockObject::$type
protected

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

Referenced by __construct(), and getType().


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