ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 . More...
 
 getObject ()
 Returns ILIAS Object. More...
 

Protected Attributes

 $ref_id
 
 $obj
 
 $request
 
 $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 15 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 42 of file class.ilObjectDAV.php.

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

43  {
44  $this->obj = &$a_obj;
45  $this->ref_id = $a_obj->getRefId();
46 
47  global $DIC;
48  $this->request = $DIC->http()->request();
49 
50  $this->dav_helper = $dav_helper;
51  $this->repo_helper = $repo_helper;
52  }
global $DIC
Definition: goto.php:24
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

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

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

◆ getLastModified()

ilObjectDAV::getLastModified ( )

Returns the last modification time as a unix timestamp.

If the information is not available, return null.

Returns
int

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

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

◆ getName()

ilObjectDAV::getName ( )

SabreDAV interface function .

See also
::getName()

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

127  {
128  return $this->obj->getTitle();
129  }

◆ getObject()

ilObjectDAV::getObject ( )

Returns ILIAS Object.

Returns
ilObject

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

References $obj.

137  {
138  return $this->obj;
139  }

◆ getObjectId()

ilObjectDAV::getObjectId ( )

Returns the object id of this object.

Returns
int.

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

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

◆ getRefId()

ilObjectDAV::getRefId ( )

Returns the ref id of this object.

Returns
int.

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

References $ref_id.

59  {
60  return $this->ref_id;
61  }

◆ setName()

ilObjectDAV::setName (   $a_name)

Renames the node.

Parameters
string$a_nameThe new name
Exceptions
Sabre

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

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

Field Documentation

◆ $dav_helper

ilObjectDAV::$dav_helper
protected

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

Referenced by __construct().

◆ $obj

ilObjectDAV::$obj
protected

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

Referenced by getObject().

◆ $ref_id

ilObjectDAV::$ref_id
protected

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

Referenced by getRefId().

◆ $repo_helper

ilObjectDAV::$repo_helper
protected

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

Referenced by __construct().

◆ $request

ilObjectDAV::$request
protected

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


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