Property
Property
Represents a WebDAV property, supporting dynamic elements and attributes.
class Property implements \ArrayAccessImplements: ArrayAccess
Provides array-like access to property attributes and elements, supports XML parsing, and enables dynamic property handling for WebDAV resources.
Properties
namespace
The XML namespace URI for this property.
private string $namespaceType: string
attributes
private array $attributesType: array
elements
private array|string $elementsType: array|string
Methods
__construct
Constructs a Property object from an optional DOM element or node.
public __construct(\DOMElement|\DOMNode|null $dom): voidParses the provided DOM node to extract namespace, attributes, and child elements, supporting both text and nested properties.
Parameters
| Parameter | Type | Description |
|---|---|---|
$dom | DOMElement | DOMNode |
__toString
Returns the string representation of the property.
public __toString(): stringReturns: string
If the property contains a text value, returns it; otherwise, returns an empty string.
__get
Magic getter for dynamic property elements.
public __get(string $key): PropertyReturns: Hazaar\HTTP\WebDAV\Property
Retrieves a child property by key, using normalized key format.
Parameters
| Parameter | Type | Description |
|---|---|---|
$key | string | the property key to retrieve |
__set
Magic setter for dynamic property elements.
public __set(string $key, mixed $value): voidReturns: void
Sets a child property by key, converting the value to a Property object if necessary.
Parameters
| Parameter | Type | Description |
|---|---|---|
$key | string | the property key to set |
$value | mixed | the value to assign, converted to Property if not already |
namespaceURI
Returns the XML namespace URI for this property.
public namespaceURI(): stringReturns: string
get
Retrieves a child property by key, returning a new empty property if not found.
public get(string $key): PropertyReturns: Hazaar\HTTP\WebDAV\Property
Parameters
| Parameter | Type | Description |
|---|---|---|
$key | string | the property key to retrieve |
has
Checks if a child property exists for the given key.
public has(string $key): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$key | string | the property key to check |
offsetExists
Checks if an attribute exists for the given offset (array access).
public offsetExists(mixed $offset): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$offset | mixed | the attribute key to check |
offsetGet
Retrieves an attribute value for the given offset (array access).
public offsetGet(mixed $offset): mixedReturns: mixed
Parameters
| Parameter | Type | Description |
|---|---|---|
$offset | mixed | the attribute key to retrieve |
offsetSet
Sets an attribute value for the given offset (array access).
public offsetSet(mixed $offset, mixed $value): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$offset | mixed | the attribute key to set |
$value | mixed | the value to assign |
offsetUnset
Unsets an attribute for the given offset (array access).
public offsetUnset(mixed $offset): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$offset | mixed | the attribute key to unset |
fkey
Normalizes a property or attribute key by replacing underscores with hyphens.
private fkey(string $key): stringReturns: string
Parameters
| Parameter | Type | Description |
|---|---|---|
$key | string | the key to normalize |
fromString
Creates a Property object from a string value.
private fromString(string $value): PropertyReturns: Hazaar\HTTP\WebDAV\Property
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string | the string value to assign to the property |
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:18 +0000