ICal\ICal::processEvents PHP Method

processEvents() public method

Adds a unix timestamp to all DT{START|END|RECURRENCE-ID}_array arrays Makes a note of modified recurrence-instances
public processEvents ( ) : void
return void or false if no Events exist
    public function processEvents()
    {
        $events = isset($this->cal['VEVENT']) ? $this->cal['VEVENT'] : array();
        if (empty($events)) {
            return false;
        }
        foreach ($events as $key => $anEvent) {
            foreach (array('DTSTART', 'DTEND', 'RECURRENCE-ID') as $type) {
                if (isset($anEvent[$type])) {
                    $date = $anEvent[$type . '_array'][1];
                    if (isset($anEvent[$type . '_array'][0]['TZID'])) {
                        $date = 'TZID=' . $anEvent[$type . '_array'][0]['TZID'] . ':' . $date;
                    }
                    $anEvent[$type . '_array'][2] = $this->iCalDateToUnixTimestamp($date);
                }
            }
            if (isset($anEvent['RECURRENCE-ID'])) {
                $uid = $anEvent['UID'];
                if (!isset($this->alteredRecurrenceInstances[$uid])) {
                    $this->alteredRecurrenceInstances[$uid] = array();
                }
                $this->alteredRecurrenceInstances[$uid][] = $anEvent['RECURRENCE-ID_array'][2];
            }
            $events[$key] = $anEvent;
        }
        $this->cal['VEVENT'] = $events;
    }