71 if (is_string($object)) {
75 throw new \InvalidArgumentException(
'String could not be parsed as \\Sabre\\VObject\\Component\\VCard by setObjects');
78 $this->objects[] = $vObj;
82 $this->objects[] = $object;
86 throw new \InvalidArgumentException(
'You can only pass strings or \\Sabre\\VObject\\Component\\VCard arguments to setObjects');
116 foreach ($this->objects as $object) {
119 if (!$object->select(
'BDAY')) {
126 if (empty($object->BDAY->getValue())) {
135 if (!isset($object->FN)) {
140 if (!$object->BDAY instanceof
Property\
VCard\DateAndOrTime) {
152 $unknownYear =
false;
154 if (!$dateParts[
'year']) {
155 $object->BDAY = self::DEFAULT_YEAR .
'-' . $dateParts[
'month'] .
'-' . $dateParts[
'date'];
162 'SUMMARY' => sprintf($this->format, $object->FN->getValue()),
163 'DTSTART' =>
new \
DateTime($object->BDAY->getValue()),
164 'RRULE' =>
'FREQ=YEARLY',
165 'TRANSP' =>
'TRANSPARENT',
169 $event->DTSTART[
'VALUE'] =
'DATE';
173 $event->add(
'X-SABRE-BDAY',
'BDAY', [
174 'X-SABRE-VCARD-UID' => $object->UID->getValue(),
175 'X-SABRE-VCARD-FN' => $object->FN->getValue(),
176 'X-SABRE-OMIT-YEAR' => self::DEFAULT_YEAR,
179 $event->add(
'X-SABRE-BDAY',
'BDAY', [
180 'X-SABRE-VCARD-UID' => $object->UID->getValue(),
181 'X-SABRE-VCARD-FN' => $object->FN->getValue(),
__construct($objects=null)
Creates the generator.
setFormat($format)
Sets the output format for the SUMMARY.
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
setObjects($objects)
Sets the input objects.
This class generates birthday calendars.
const DEFAULT_YEAR
Default year.
getResult()
Parses the input data and returns a VCALENDAR.
static parseVCardDateTime($date)
This method parses a vCard date and or time value.
This exception is thrown whenever an invalid value is found anywhere in a iCalendar or vCard object...