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) {
110 case self::UNAUTHENTICATED :
113 case self::AUTHENTICATED :
117 parent::xmlSerialize($writer);
142 switch ($this->type) {
144 case self::UNAUTHENTICATED :
145 return '<em>unauthenticated</em>';
146 case self::AUTHENTICATED :
147 return '<em>authenticated</em>';
149 return parent::toHtml($html);
151 return '<em>all</em>';
181 switch (
$tree[
'name']) {
182 case '{DAV:}unauthenticated' :
183 return new self(self::UNAUTHENTICATED);
184 case '{DAV:}authenticated' :
185 return new self(self::AUTHENTICATED);
187 return new self(self::HREF,
$tree[
'value']);
189 return new self(self::ALL);
191 throw new BadRequest(
'Unknown or unsupported principal type: ' .
$tree[
'name']);
parseInnerTree(array $elementMap=null)
Parses all elements below the current element.
const ALL
Everybody, basically.
__construct($type, $href=null)
Creates the property.
const UNAUTHENTICATED
To specify a not-logged-in user, use the UNAUTHENTICATED principal.
static xmlDeserialize(Reader $reader)
The deserialize method is called during xml parsing.
The Reader class expands upon PHP's built-in XMLReader.
const AUTHENTICATED
To specify any principal that is logged in, use AUTHENTICATED.
xmlSerialize(Writer $writer)
The xmlSerialize method is called during xml writing.
const HREF
Specific principals can be specified with the HREF.
getType()
Returns the principal type.
writeElement($name, $content=null)
Write a full element tag and it's contents.
toHtml(HtmlOutputHelper $html)
Generate html representation for this value.
This class provides a few utility functions for easily generating HTML for the browser plugin...