ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SupportedMethodSet.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Sabre\DAV\Xml\Property;
4 
9 
24 
30  protected $methods = [];
31 
37  function __construct(array $methods) {
38 
39  $this->methods = $methods;
40 
41  }
42 
48  function getValue() {
49 
50  return $this->methods;
51 
52  }
53 
60  function has($methodName) {
61 
62  return in_array(
63  $methodName,
64  $this->methods
65  );
66 
67  }
68 
88  function xmlSerialize(Writer $writer) {
89 
90  foreach ($this->getValue() as $val) {
91  $writer->startElement('{DAV:}supported-method');
92  $writer->writeAttribute('name', $val);
93  $writer->endElement();
94  }
95 
96  }
97 
113 
114  return implode(
115  ', ',
116  array_map([$html, 'h'], $this->getValue())
117  );
118 
119  }
120 
121 }
Objects implementing XmlSerializable can control how they are represented in Xml. ...
writeAttribute($name, $value)
Writes a new attribute.
Definition: Writer.php:230
xmlSerialize(Writer $writer)
The xmlSerialize method is called during xml writing.
has($methodName)
Returns true or false if the property contains a specific method.
startElement($name)
Opens a new element.
Definition: Writer.php:121
toHtml(HtmlOutputHelper $html)
Generate html representation for this value.
getValue()
Returns the list of supported http methods.
WebDAV properties that implement this interface are able to generate their own html output for the br...
Definition: HtmlOutput.php:16
__construct(array $methods)
Creates the property.
$html
Definition: example_001.php:87
The XML Writer class.
Definition: Writer.php:31
This class provides a few utility functions for easily generating HTML for the browser plugin...