Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function buildPropertyBag()
 {
     $propertyBag = new PropertyBag();
     $propertyBag->set('TZID', $this->timezone);
     $propertyBag->set('X-LIC-LOCATION', $this->timezone);
     return $propertyBag;
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function buildPropertyBag()
 {
     $propertyBag = new PropertyBag();
     if (null != $this->getTzName()) {
         $propertyBag->set('TZNAME', $this->getTzName());
     }
     if (null != $this->getTzOffsetFrom()) {
         $propertyBag->set('TZOFFSETFROM', $this->getTzOffsetFrom());
     }
     if (null != $this->getTzOffsetTo()) {
         $propertyBag->set('TZOFFSETTO', $this->getTzOffsetTo());
     }
     if (null != $this->getDtStart()) {
         $propertyBag->set('DTSTART', $this->getDtStart());
     }
     if (null != $this->recurrenceRule) {
         $propertyBag->set('RRULE', $this->recurrenceRule);
     }
     return $propertyBag;
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 public function buildPropertyBag()
 {
     $propertyBag = new PropertyBag();
     if (null != $this->trigger) {
         $propertyBag->set('TRIGGER', $this->trigger);
     }
     if (null != $this->action) {
         $propertyBag->set('ACTION', $this->action);
     }
     if (null != $this->repeat) {
         $propertyBag->set('REPEAT', $this->repeat);
     }
     if (null != $this->duration) {
         $propertyBag->set('DURATION', $this->duration);
     }
     if (null != $this->description) {
         $propertyBag->set('DESCRIPTION', $this->description);
     }
     if (null != $this->attendee) {
         $propertyBag->set('ATTENDEE', $this->attendee);
     }
     return $propertyBag;
 }
Esempio n. 4
0
 /**
  * {@inheritdoc}
  */
 public function buildPropertyBag()
 {
     $propertyBag = new PropertyBag();
     // mandatory information
     $propertyBag->set('UID', $this->uniqueId);
     $propertyBag->add(new DateTimeProperty('DTSTART', $this->dtStart, $this->noTime, $this->useTimezone, $this->useUtc));
     $propertyBag->set('SEQUENCE', $this->sequence);
     $propertyBag->set('TRANSP', $this->transparency);
     if ($this->status) {
         $propertyBag->set('STATUS', $this->status);
     }
     // An event can have a 'dtend' or 'duration', but not both.
     if (null != $this->dtEnd) {
         $propertyBag->add(new DateTimeProperty('DTEND', $this->dtEnd, $this->noTime, $this->useTimezone, $this->useUtc));
     } elseif (null != $this->duration) {
         $propertyBag->set('DURATION', $this->duration->format('P%dDT%hH%iM%sS'));
     }
     // optional information
     if (null != $this->url) {
         $propertyBag->set('URL', $this->url);
     }
     if (null != $this->location) {
         $propertyBag->set('LOCATION', $this->location);
         if (null != $this->locationGeo) {
             $propertyBag->add(new Property('X-APPLE-STRUCTURED-LOCATION', 'geo:' . $this->locationGeo, array('VALUE' => 'URI', 'X-ADDRESS' => $this->location, 'X-APPLE-RADIUS' => 49, 'X-TITLE' => $this->locationTitle)));
         }
     }
     if (null != $this->summary) {
         $propertyBag->set('SUMMARY', $this->summary);
     }
     if (null != $this->attendees) {
         $propertyBag->add($this->attendees);
     }
     $propertyBag->set('CLASS', $this->isPrivate ? 'PRIVATE' : 'PUBLIC');
     if (null != $this->description) {
         $propertyBag->set('DESCRIPTION', $this->description);
     }
     if (null != $this->recurrenceRule) {
         $propertyBag->set('RRULE', $this->recurrenceRule);
     }
     if (null != $this->recurrenceId) {
         $this->recurrenceId->applyTimeSettings($this->noTime, $this->useTimezone, $this->useUtc);
         $propertyBag->add($this->recurrenceId);
     }
     if (!empty($this->exDates)) {
         $propertyBag->add(new DateTimesProperty('EXDATE', $this->exDates, $this->noTime, $this->useTimezone, $this->useUtc));
     }
     if ($this->cancelled) {
         $propertyBag->set('STATUS', 'CANCELLED');
     }
     if (null != $this->organizer) {
         $propertyBag->add($this->organizer);
     }
     if ($this->noTime) {
         $propertyBag->set('X-MICROSOFT-CDO-ALLDAYEVENT', 'TRUE');
     }
     if (null != $this->categories) {
         $propertyBag->set('CATEGORIES', $this->categories);
     }
     $propertyBag->add(new DateTimeProperty('DTSTAMP', $this->dtStamp ?: new \DateTime(), false, false, true));
     if ($this->created) {
         $propertyBag->add(new DateTimeProperty('CREATED', $this->created, false, false, true));
     }
     if ($this->modified) {
         $propertyBag->add(new DateTimeProperty('LAST-MODIFIED', $this->modified, false, false, true));
     }
     return $propertyBag;
 }
Esempio n. 5
0
 /**
  * {@inheritdoc}
  */
 public function buildPropertyBag()
 {
     $propertyBag = new PropertyBag();
     $propertyBag->set('VERSION', '2.0');
     $propertyBag->set('PRODID', $this->prodId);
     if ($this->method) {
         $propertyBag->set('METHOD', $this->method);
     }
     if ($this->calendarColor) {
         $propertyBag->set('X-APPLE-CALENDAR-COLOR', $this->calendarColor);
         $propertyBag->set('X-OUTLOOK-COLOR', $this->calendarColor);
         $propertyBag->set('X-FUNAMBOL-COLOR', $this->calendarColor);
     }
     if ($this->calendarScale) {
         $propertyBag->set('CALSCALE', $this->calendarScale);
         $propertyBag->set('X-MICROSOFT-CALSCALE', $this->calendarScale);
     }
     if ($this->name) {
         $propertyBag->set('X-WR-CALNAME', $this->name);
     }
     if ($this->description) {
         $propertyBag->set('X-WR-CALDESC', $this->description);
     }
     if ($this->timezone) {
         if ($this->timezone instanceof Timezone) {
             $propertyBag->set('X-WR-TIMEZONE', $this->timezone->getZoneIdentifier());
             $this->addComponent($this->timezone);
         } else {
             $propertyBag->set('X-WR-TIMEZONE', $this->timezone);
             $this->addComponent(new Timezone($this->timezone));
         }
     }
     if ($this->forceInspectOrOpen) {
         $propertyBag->set('X-MS-OLK-FORCEINSPECTOROPEN', $this->forceInspectOrOpen);
     }
     if ($this->calId) {
         $propertyBag->set('X-WR-RELCALID', $this->calId);
     }
     if ($this->publishedTTL) {
         $propertyBag->set('X-PUBLISHED-TTL', $this->publishedTTL);
     }
     return $propertyBag;
 }