Property
Property
Represents a WebDAV property, supporting dynamic elements and attributes.
class Property implements \ArrayAccessProvides 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 $namespaceattributes
private array $attributeselements
public string $elementsMethods
__construct
Constructs a Property object from an optional DOM element or node.
public __construct(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 | null | the DOM element or node to parse, or null for an empty property |
__toString
Returns the string representation of the property.
public __toString(): stringIf the property contains a text value, returns it; otherwise, returns an empty string.
__get
Magic getter for dynamic property elements.
public __get(string $key): PropertyRetrieves 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): voidSets 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(): stringget
Retrieves a child property by key, returning a new empty property if not found.
public get(string $key): PropertyParameters
| 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): boolParameters
| 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): boolParameters
| 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): mixedParameters
| 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): voidParameters
| 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): voidParameters
| 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): stringParameters
| Parameter | Type | Description |
|---|---|---|
$key | string | the key to normalize |
fromString
Creates a Property object from a string value.
private fromString(string $value): PropertyParameters
| Parameter | Type | Description |
|---|---|---|
$value | string | the string value to assign to the property |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:25 +0000