ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilObjectDAV.php
Go to the documentation of this file.
1 <?php
2 
6 
17 abstract class ilObjectDAV extends Sabre\DAV\Node
18 {
20  protected $ref_id;
21 
23  protected $obj;
24 
26  protected $repo_helper;
27 
29  protected $dav_helper;
30 
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  }
51 
56  public function getRefId()
57  {
58  return $this->ref_id;
59  }
60 
65  public function getObjectId()
66  {
67  return ($this->obj == null) ? null : $this->obj->getId();
68  }
69 
77  public function getLastModified()
78  {
79  return ($this->obj == null) ? null : strtotime($this->obj->getLastUpdateDate());
80  }
81 
89  public function delete()
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  }
97 
105  public function setName($a_name)
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  }
118 
124  public function getName()
125  {
126  return $this->obj->getTitle();
127  }
128 
134  public function getObject()
135  {
136  return $this->obj;
137  }
138 }
getObjectId()
Returns the object id of this object.
global $DIC
Definition: saml.php:7
Class ilWebDAVRepositoryHelper.
setName($a_name)
Renames the node.
getObject()
Returns ILIAS Object.
getLastModified()
Returns the last modification time as a unix timestamp.
Class ilWebDAVObjDAVHelper.
Node class.
Definition: Node.php:14
Class ilObjectDAV.
getRefId()
get reference id public
__construct(ilObject $a_obj, ilWebDAVRepositoryHelper $repo_helper, ilWebDAVObjDAVHelper $dav_helper)
Constructor for DAV Object.
getName()
SabreDAV interface function Returns the name of the node.This is used to generate the url...
getRefId()
Returns the ref id of this object.