コード例 #1
0
 /**
  * Gets UID of a calendar this event belongs to
  * The calendar UID is a string includes a calendar alias and id in the following format: {alias}_{id}
  *
  * @return string|null
  */
 public function getCalendarUid()
 {
     if ($this->calendar) {
         return sprintf('%s_%d', Calendar::CALENDAR_ALIAS, $this->calendar->getId());
     } elseif ($this->systemCalendar) {
         $alias = $this->systemCalendar->isPublic() ? SystemCalendar::PUBLIC_CALENDAR_ALIAS : SystemCalendar::CALENDAR_ALIAS;
         return sprintf('%s_%d', $alias, $this->systemCalendar->getId());
     }
     return null;
 }