65 if (
$type === self::HREF && is_null($href)) {
66 throw new DAV\Exception(
'The href argument must be specified for the HREF principal type.');
69 $href = rtrim($href,
'/') .
'/';
70 parent::__construct($href);
108 switch ($this->type) {
117 parent::xmlSerialize($writer);
142 switch ($this->type) {
145 return '<em>unauthenticated</em>';
147 return '<em>authenticated</em>';
149 return parent::toHtml(
$html);
151 return '<em>all</em>';
181 switch (
$tree[
'name']) {
182 case '{DAV:}unauthenticated' :
184 case '{DAV:}authenticated' :
191 throw new BadRequest(
'Unknown or unsupported principal type: ' .
$tree[
'name']);
An exception for terminatinating execution or to throw for unit testing.
static xmlDeserialize(Reader $reader)
The deserialize method is called during xml parsing.
toHtml(HtmlOutputHelper $html)
Generate html representation for this value.
const UNAUTHENTICATED
To specify a not-logged-in user, use the UNAUTHENTICATED principal.
const ALL
Everybody, basically.
__construct($type, $href=null)
Creates the property.
const HREF
Specific principals can be specified with the HREF.
getType()
Returns the principal type.
const AUTHENTICATED
To specify any principal that is logged in, use AUTHENTICATED.
xmlSerialize(Writer $writer)
The xmlSerialize method is called during xml writing.
This class provides a few utility functions for easily generating HTML for the browser plugin.
The Reader class expands upon PHP's built-in XMLReader.
writeElement($name, $content=null)
Write a full element tag and it's contents.