Converts PHP values to properties, the reverse of ValueParser; used by Calendar::create(),
Event::new() and the other factories. Date-time values: a DateTimeInterface with a named (IANA) timezone keeps its local time and
gets a TZID parameter, a UTC one is written with "Z", other ones (offsets like "+02:00" and
abbreviations like "CEST" are not timezones) are converted to UTC. A DateTimeValue keeps its
kind (DATE, floating, UTC, zoned), a string is an iCalendar value like "20260105T093000Z".
| Methods |
public
static
|
dateTimeValue(DateInput $value): DateTimeValue
A DATE or DATE-TIME value of a PHP value, see the class description.
A DATE or DATE-TIME value of a PHP value, see the class description.
Throws
|
#
|
public
static
|
utcValue(DateInput $value, string $name): DateTimeValue
A UTC instant, e.g. for DTSTAMP; dates and floating times are rejected.
A UTC instant, e.g. for DTSTAMP; dates and floating times are rejected.
Throws
|
#
|
public
static
|
dateTime(string $name, DateInput $value, array<string, string|list<string>> $parameters = []): Property
DATE-TIME property: TZID for zoned times, VALUE=DATE for dates; UTC for DTSTAMP, CREATED, ....
DATE-TIME property: TZID for zoned times, VALUE=DATE for dates; UTC for DTSTAMP, CREATED, ....
|
#
|
public
static
|
dateTimes(string $name, iterable<DateTimeInterface|DateTimeValue|Period|string> $values): list<Property>
EXDATE or RDATE: values of the same kind share one property (RDATE also takes periods).
EXDATE or RDATE: values of the same kind share one property (RDATE also takes periods).
|
#
|
public
static
|
duration(DateInterval|string $duration): string
A DURATION value; months and years are not allowed (RFC 5545, section 3.3.6).
A DURATION value; months and years are not allowed (RFC 5545, section 3.3.6).
Throws
|
#
|
public
static
|
rule(Rule|string $rule): Rule
A validated recurrence rule.
A validated recurrence rule.
Throws
|
#
|
public
static
|
text(string $name, string $value, array<string, string|list<string>> $parameters = []): Property
|
#
|
public
static
|
texts(string $name, iterable<string> $values): ?Property
A list of TEXT values (CATEGORIES, RESOURCES, LOCATION-TYPE): every item is escaped.
A list of TEXT values (CATEGORIES, RESOURCES, LOCATION-TYPE): every item is escaped.
|
#
|
public
static
|
uri(string $name, string $uri, array<string, string|list<string>>|Parameters $parameters = []): Property
A URI; whitespace and control characters are not allowed.
A URI; whitespace and control characters are not allowed.
|
#
|
public
static
|
calAddress(string $name, CalAddress|string $address): Property
|
#
|
public
static
|
geo(array{(float|int), (float|int)} $geo): Property
GEO: latitude and longitude with at most six decimals.
GEO: latitude and longitude with at most six decimals.
|
#
|
public
static
|
image(Image|string $image): Property
|
#
|
public
static
|
conference(Conference|string $conference): Property
|
#
|
public
static
|
link(Link|string $link): Property
LINK (RFC 9253): a URI, or a UID or an XML reference by the VALUE parameter of the Link.
LINK (RFC 9253): a URI, or a UID or an XML reference by the VALUE parameter of the Link.
|
#
|
public
static
|
relation(Relation|string $relation): Property
RELATED-TO: a UID (default), or a URI by the VALUE parameter of the Relation.
RELATED-TO: a UID (default), or a URI by the VALUE parameter of the Relation.
|
#
|
public
static
|
properties(PropertyList $properties): list<Property>
Properties of the "properties:" argument: Property objects, or name => value pairs where
a string is the raw value and other PHP values are converted by their type (a VALUE
parameter is added when it is not the default type of the property, see ValueParser::TYPES).
Properties of the "properties:" argument: Property objects, or name => value pairs where
a string is the raw value and other PHP values are converted by their type (a VALUE
parameter is added when it is not the default type of the property, see ValueParser::TYPES).
Throws
|
#
|
public
static
|
value(string $name, mixed $value): Property
A property of a PHP value (PropertyValue), see properties().
A property of a PHP value (PropertyValue), see properties().
Throws
|
#
|
public
static
|
isTimezoneName(string $name): bool
Timezone name that other programs understand: an IANA identifier (also a backward link like
US/Eastern), not an offset or an abbreviation.
Timezone name that other programs understand: an IANA identifier (also a backward link like
US/Eastern), not an offset or an abbreviation.
|
#
|
public
static
|
sameKind(DateTimeValue $value, DateTimeValue $reference, string $what): DateTimeValue
A value of the same kind (DATE or DATE-TIME) as the reference.
A value of the same kind (DATE or DATE-TIME) as the reference.
Throws
|
#
|