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

Class ilObjectDAV. More...

+ Inheritance diagram for ilObjectDAV:
+ Collaboration diagram for ilObjectDAV:

Public Member Functions

 __construct (ilObject $a_obj, ilWebDAVRepositoryHelper $repo_helper, ilWebDAVObjDAVHelper $dav_helper)
 Constructor for DAV Object. More...
 
 getRefId ()
 Returns the ref id of this object. More...
 
 getObjectId ()
 Returns the object id of this object. More...
 
 getLastModified ()
 Returns the last modification time as a unix timestamp. More...
 
 delete ()
 Deletes the current node. More...
 
 setName ($a_name)
 Renames the node. More...
 
 getName ()
 SabreDAV interface function Returns the name of the node.This is used to generate the url.
Returns
string
. More...
 
 getObject ()
 Returns ILIAS Object. More...
 
- Public Member Functions inherited from Sabre\DAV\Node
 getLastModified ()
 Returns the last modification time as a unix timestamp. More...
 
 delete ()
 Deletes the current node. More...
 
 setName ($name)
 Renames the node. More...
 

Protected Attributes

 $ref_id
 
 $obj
 
 $repo_helper
 
 $dav_helper
 

Detailed Description

Class ilObjectDAV.

Base implementation for all ILIAS objects to be represented as a WebDAV object

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

Definition at line 17 of file class.ilObjectDAV.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjectDAV::__construct ( ilObject  $a_obj,
ilWebDAVRepositoryHelper  $repo_helper,
ilWebDAVObjDAVHelper  $dav_helper 
)

Constructor for DAV Object.

Note: There is a good reason why I want an ILIAS-Object in the constructor and not a ref_id. This is because every instance of ilObjectDAV and its inherited children represent an ILIAS-object for WebDAV. If there isn't an ILIAS-object there is no object to represent for WebDAV.

Parameters
ilObject$a_obj

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

References $dav_helper, $DIC, $repo_helper, and ilObject\getRefId().

42  {
43  global $DIC;
44 
45  $this->obj = &$a_obj;
46  $this->ref_id = $a_obj->getRefId();
47 
48  $this->dav_helper = $dav_helper;
49  $this->repo_helper = $repo_helper;
50  }
global $DIC
Definition: saml.php:7
getRefId()
get reference id public
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilObjectDAV::delete ( )

Deletes the current node.

Exceptions
Sabre

Implements Sabre\DAV\INode.

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

90  {
91  if ($this->repo_helper->checkAccess('delete', $this->ref_id)) {
92  $this->repo_helper->deleteObject($this->ref_id);
93  } else {
94  throw new Forbidden("Permission denied");
95  }
96  }

◆ getLastModified()

ilObjectDAV::getLastModified ( )

Returns the last modification time as a unix timestamp.

If the information is not available, return null.

Returns
int

Implements Sabre\DAV\INode.

Definition at line 77 of file class.ilObjectDAV.php.

78  {
79  return ($this->obj == null) ? null : strtotime($this->obj->getLastUpdateDate());
80  }

◆ getName()

ilObjectDAV::getName ( )

SabreDAV interface function Returns the name of the node.This is used to generate the url.

Returns
string
.

See also
::getName()

Implements Sabre\DAV\INode.

Definition at line 124 of file class.ilObjectDAV.php.

125  {
126  return $this->obj->getTitle();
127  }

◆ getObject()

ilObjectDAV::getObject ( )

Returns ILIAS Object.

Returns
ilObject

Definition at line 134 of file class.ilObjectDAV.php.

References $obj.

135  {
136  return $this->obj;
137  }

◆ getObjectId()

ilObjectDAV::getObjectId ( )

Returns the object id of this object.

Returns
int.

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

66  {
67  return ($this->obj == null) ? null : $this->obj->getId();
68  }

◆ getRefId()

ilObjectDAV::getRefId ( )

Returns the ref id of this object.

Returns
int.

Definition at line 56 of file class.ilObjectDAV.php.

References $ref_id.

57  {
58  return $this->ref_id;
59  }

◆ setName()

ilObjectDAV::setName (   $a_name)

Renames the node.

Parameters
string$a_nameThe new name
Exceptions
Sabre

Implements Sabre\DAV\INode.

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

106  {
107  if ($this->repo_helper->checkAccess("write", $this->obj->getRefId())) {
108  if ($this->dav_helper->isDAVableObjTitle($a_name)) {
109  $this->obj->setTitle($a_name);
110  $this->obj->update();
111  } else {
112  throw new Forbidden('Forbidden characters in title');
113  }
114  } else {
115  throw new Forbidden('Permission denied');
116  }
117  }

Field Documentation

◆ $dav_helper

ilObjectDAV::$dav_helper
protected

Definition at line 29 of file class.ilObjectDAV.php.

Referenced by __construct().

◆ $obj

ilObjectDAV::$obj
protected

Definition at line 23 of file class.ilObjectDAV.php.

Referenced by getObject().

◆ $ref_id

ilObjectDAV::$ref_id
protected

Definition at line 20 of file class.ilObjectDAV.php.

Referenced by getRefId().

◆ $repo_helper

ilObjectDAV::$repo_helper
protected

Definition at line 26 of file class.ilObjectDAV.php.

Referenced by __construct().


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