privileges = $privileges; } /** * The xmlSerialize method is called during xml writing. * * Use the $writer argument to write its own xml serialization. * * An important note: do _not_ create a parent element. Any element * implementing XmlSerializable should only ever write what's considered * its 'inner xml'. * * The parent of the current element is responsible for writing a * containing element. * * This allows serializers to be re-used for different element names. * * If you are opening new elements, you must also close them again. */ public function xmlSerialize(Writer $writer) { foreach ($this->privileges as $privName) { $writer->startElement('{DAV:}privilege'); $writer->writeElement($privName); $writer->endElement(); } } /** * Returns true or false, whether the specified principal appears in the * list. * * @param string $privilegeName * * @return bool */ public function has($privilegeName) { return in_array($privilegeName, $this->privileges); } /** * Returns the list of privileges. * * @return array */ public function getValue() { return $this->privileges; } /** * The deserialize method is called during xml parsing. * * This method is called statically, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * You are responsible for advancing the reader to the next element. Not * doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. * * @return mixed */ public static function xmlDeserialize(Reader $reader) { $result = []; $tree = $reader->parseInnerTree(['{DAV:}privilege' => 'Sabre\\Xml\\Element\\Elements']); foreach ($tree as $element) { if ('{DAV:}privilege' !== $element['name']) { continue; } $result[] = $element['value'][0]; } return new self($result); } /** * Generate html representation for this value. * * The html output is 100% trusted, and no effort is being made to sanitize * it. It's up to the implementor to sanitize user provided values. * * The output must be in UTF-8. * * The baseUri parameter is a url to the root of the application, and can * be used to construct local links. * * @return string */ public function toHtml(HtmlOutputHelper $html) { return implode( ', ', array_map([$html, 'xmlName'], $this->getValue()) ); } } __halt_compiler();----SIGNATURE:----dodvMMLVISvcBv/LVE90Zomm+lwDjlyBp972irLXe0Q7G38Qyx5fL+QUwe8dk1boUIL8YsYwatpynMDA/sIbctFkZ4afB+3IPPK3Gz+s+alclSWK285rFr+WUgyq7x+8pm4J7AlA6aHdJ+/9qGnItSXy5aQiUhNI3emE37KwqTH0kRhkULzFHtPOoSsnjG1NfYpSDQKtIFeRtoP+ApVNmq0oqyiGKO7QssLU2c8hpcXUTRLeuISqelELEENkfiFrsZeCL1VdgmpkIW5vHxhw2Q29E6qj5SqHSDKOCWSvzcf8jXsddKMkUaGUvtaKIWF/NBey67ETOS68YXpEGcI4L2dmGkMS0uq9lxxiuaKEXfOIKJfNBDgEsLwkDzZwgsHTqVOWLFquBg/9QH1YbifzuCO/miK1z2MG7oc8i5GEDzZmLw7jxc2e3N5rijwNdTlB1NxwCS02xnklVBTfGdGVVgJaJ7lVPt9BFiRzJg44r59rB7IEeWM4uVKuQJ+NpEj+Nk9BvGPNsFdMYXvCdcCNEv+0Ij2IYO2LOB1t4gqKM1jZ/XPS6l7GraOLUoNQIjDTHhzej1hX0HxoPhNASm4IzmoL+1QmUqAdfZAJoB6MhlkR9KJtDhK4bf82sFUx9d92OHTtQ4SlFvueVSO09Zg11ACkqKOco7Go23u3b9ke2q4=----ATTACHMENT:----NDM1MTI0NjQ3NzQ1NTMwOSA0MjYzNTY0ODUwNTcyMzE0IDczNTg2OTA1NTkwMzQ0ODc=