ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
 
 $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, $repo_helper, and ilObject\getRefId().

42  {
43  $this->obj = &$a_obj;
44  $this->ref_id = $a_obj->getRefId();
45 
46  $this->dav_helper = $dav_helper;
47  $this->repo_helper = $repo_helper;
48  }
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 87 of file class.ilObjectDAV.php.

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

◆ 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 75 of file class.ilObjectDAV.php.

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

◆ getName()

ilObjectDAV::getName ( )

SabreDAV interface function .

See also
::getName()

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

123  {
124  return $this->obj->getTitle();
125  }

◆ getObject()

ilObjectDAV::getObject ( )

Returns ILIAS Object.

Returns
ilObject

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

References $obj.

133  {
134  return $this->obj;
135  }

◆ getObjectId()

ilObjectDAV::getObjectId ( )

Returns the object id of this object.

Returns
int.

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

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

◆ getRefId()

ilObjectDAV::getRefId ( )

Returns the ref id of this object.

Returns
int.

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

References $ref_id.

55  {
56  return $this->ref_id;
57  }

◆ setName()

ilObjectDAV::setName (   $a_name)

Renames the node.

Parameters
string$a_nameThe new name
Exceptions
Sabre

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

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

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: