AnewtCalendar class

A class representing an iCalendar calendar object.

Class Overview

A class representing an iCalendar calendar object.

It has some basic properties and may contain one or more events (represented by AnewtCalendarEvent). An instance of this class can be serialized to a text/calendar (.ics) file, which can be imported into calendering applications such as Evolution, iCal or Outlook.

The available properties are:

A filename is optional, but it is recommended to set one for better client compatibility, since some platforms ignore the MIME type information and rely on the file name (extension) to determine what actions to perform.

See also

Public Methods

__construct()

Construct a new AnewtCalendar instance.

add_event($event)

Add an event to the calendar.

Parameters

$event

An AnewtCalendarEvent instance

render()

Render this calendar to a string in iCal format.

Return value

String representation of this calendar

flush()

Output the calendar to a browser.

This renders the calendar and all its asssociated events, and sends the output to the browser with the correct HTTP headers for the MIME type and (optionally) the downoad filename.

Private Static Methods

static escape_string($str, $multiline) [private] [static]

Escape a string so that it can be used for TEXT fields.

Newlines and other characters are escaped to match the iCalendar specification.

Parameters

$str

A string to escape.

$multiline

Boolean to indicate whether this is a multiline string. This affects how the string is escaped.

Return value

The escaped string

Private Attributes

$events [private]

Array holding all events.

Inheritance

Base Classes

Inherited members