Skip to content

Properties and components ​

Use the typed fields for common data. Use Property and Component for repeated values, extensions, unknown fields, and component types without a dedicated model.

Property lookup ​

Calendar, Event, Todo, Journal, Alarm, and Component expose the same direct-property methods:

php
$object->properties();
$object->properties('ATTENDEE');
$object->hasProperty();
$object->hasProperty('RRULE');
$object->property('SUMMARY');

Names are trimmed and compared case-insensitively. null means every direct property; an empty name throws InvalidArgumentException. Lookup never recurses. property() returns the first match, while properties() preserves every match and its document order.

Property values ​

MemberTypeMeaning
namestringUppercase property name.
typestringValue type, such as text, date-time, or recur.
valuevalue/list/nullnull for no values, the value for one, or a list for multiple values.
valueslist<PropertyAtom>Every value carried by the property.
parameters()array<string,string|list<string>>All parameters with uppercase names.
parameter($name)string|list<string>|nullOne case-insensitive parameter lookup.
rawValue()stringThe normalized property value as text.
toArray()arrayname, type, value, values, parameters, and raw_value.

PropertyAtom may be bool, int, float, string, CarbonImmutable, DateInterval, or a structured array such as an RRULE map. rawValue() does not include the property name, parameters, or original line folding.

Component lookup ​

Calendar exposes its first-level children through components(?string $name = null), hasComponent(?string $name = null), and component(string $name). A generic Component exposes components(?string $name = null) for its own first-level children.

php
$freeBusy = $calendar->component('VFREEBUSY');
$periods = $freeBusy?->properties('FREEBUSY');
$fbType = $periods?->first()?->parameter('FBTYPE');

Names are trimmed, case-insensitive, and non-empty. Lookup only examines the next level; component() returns the first match or null. Component::$name is uppercase. Generic components can represent VEVENT, VTODO, VJOURNAL, VFREEBUSY, VTIMEZONE, and unknown X-* components.

Raw component access ​

Calendar, Event, Todo, Journal, Alarm, and Component provide rawComponent() for advanced access to the corresponding Sabre component.

Last updated:

Released under the MIT License.