ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ScheduleCalendarTransp.php
Go to the documentation of this file.
1<?php
2
4
10
28
29 const TRANSPARENT = 'transparent';
30 const OPAQUE = 'opaque';
31
37 protected $value;
38
44 function __construct($value) {
45
46 if ($value !== self::TRANSPARENT && $value !== self::OPAQUE) {
47 throw new \InvalidArgumentException('The value must either be specified as "transparent" or "opaque"');
48 }
49 $this->value = $value;
50
51 }
52
58 function getValue() {
59
60 return $this->value;
61
62 }
63
83 function xmlSerialize(Writer $writer) {
84
85 switch ($this->value) {
87 $writer->writeElement('{' . Plugin::NS_CALDAV . '}transparent');
88 break;
89 case self::OPAQUE :
90 $writer->writeElement('{' . Plugin::NS_CALDAV . '}opaque');
91 break;
92 }
93
94 }
95
117 static function xmlDeserialize(Reader $reader) {
118
120
121 if (in_array('transparent', $elems)) {
123 } else {
125 }
126 return new self($value);
127
128 }
129
130}
An exception for terminatinating execution or to throw for unit testing.
CalDAV plugin.
Definition: Plugin.php:28
const NS_CALDAV
This is the official CalDAV namespace.
Definition: Plugin.php:33
xmlSerialize(Writer $writer)
The xmlSerialize method is called during xml writing.
static xmlDeserialize(Reader $reader)
The deserialize method is called during xml parsing.
The Reader class expands upon PHP's built-in XMLReader.
Definition: Reader.php:20
The XML Writer class.
Definition: Writer.php:31
writeElement($name, $content=null)
Write a full element tag and it's contents.
Definition: Writer.php:189
This is the XML element interface.
Definition: Element.php:18
enum(Reader $reader, $namespace=null)
The 'enum' deserializer parses elements into a simple list without values or attributes.
Definition: functions.php:140