ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PropFindAll.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\DAV\Browser;
4
6
15class PropFindAll extends PropFind {
16
22 function __construct($path) {
23
24 parent::__construct($path, []);
25
26 }
27
50 function handle($propertyName, $valueOrCallBack) {
51
52 if (is_callable($valueOrCallBack)) {
53 $value = $valueOrCallBack();
54 } else {
55 $value = $valueOrCallBack;
56 }
57 if (!is_null($value)) {
58 $this->result[$propertyName] = [200, $value];
59 }
60
61 }
62
74 function set($propertyName, $value, $status = null) {
75
76 if (is_null($status)) {
77 $status = is_null($value) ? 404 : 200;
78 }
79 $this->result[$propertyName] = [$status, $value];
80
81 }
82
89 function get($propertyName) {
90
91 return isset($this->result[$propertyName]) ? $this->result[$propertyName][1] : null;
92
93 }
94
104 function getStatus($propertyName) {
105
106 return isset($this->result[$propertyName]) ? $this->result[$propertyName][0] : 404;
107
108 }
109
116 function get404Properties() {
117
118 $result = [];
119 foreach ($this->result as $propertyName => $stuff) {
120 if ($stuff[0] === 404) {
121 $result[] = $propertyName;
122 }
123 }
124 // If there's nothing in this list, we're adding one fictional item.
125 if (!$result) {
126 $result[] = '{http://sabredav.org/ns}idk';
127 }
128 return $result;
129
130 }
131
132}
An exception for terminatinating execution or to throw for unit testing.
This class is used by the browser plugin to trick the system in returning every defined property.
Definition: PropFindAll.php:15
handle($propertyName, $valueOrCallBack)
Handles a specific property.
Definition: PropFindAll.php:50
get404Properties()
Returns all propertynames that have a 404 status, and thus don't have a value yet.
__construct($path)
Creates the PROPFIND object.
Definition: PropFindAll.php:22
getStatus($propertyName)
Returns the current status code for a property name.
This class holds all the information about a PROPFIND request.
Definition: PropFind.php:11