Class Horde_iCalendar

Description

Class representing iCalendar files.

$Horde: framework/iCalendar/iCalendar.php,v 1.57.4.81 2010-11-10 14:34:25 jan Exp $

Copyright 2003-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /iCalendar/iCalendar.php (line 26)


	
			
Direct descendents
Class Description
 class Horde_iCalendar_valarm Class representing vAlarms.
 class Horde_iCalendar_vcard Class representing vCard entries.
 class Horde_iCalendar_vevent Class representing vEvents.
 class Horde_iCalendar_vfreebusy Class representing vFreebusy components.
 class Horde_iCalendar_vjournal Class representing vJournals.
 class Horde_iCalendar_vnote Class representing vNotes.
 class Horde_iCalendar_vtimezone Class representing vTimezones.
 class Horde_iCalendar_standard
 class Horde_iCalendar_daylight
 class Horde_iCalendar_vtodo Class representing vTodos.
Variable Summary
Method Summary
 static object Reference &newComponent (string $type,  &$container, Horde_iCalendar $container)
 static void _parseDate ( $text)
 static void _parseTime ( $text)
 Horde_iCalendar Horde_iCalendar ([ $version = '2.0'])
 void addComponent (Horde_iCalendar $component)
 void clear ()
 void exportvCalendar ()
 boolean|Horde_iCalendar_* &findComponent ( $childclass, string $type)
 boolean|Horde_iCalendar_* &findComponentByAttribute (string $childclass, string $attribute, [string $value = null])
 array getAllAttributes ([string $tag = false])
 mixed getAttribute (string $name, [boolean $params = false])
 mixed getAttributeDefault (string $name, [mixed $default = ''])
 mixed getAttributeValues (string $name)
 mixed getComponent (integer $idx)
 integer getComponentCount ()
 array getComponents ()
 void getType ()
 void isOldFormat ()
 boolean parsevCalendar (string $text, [string $base = 'VCALENDAR'], [string $charset = null], [boolean $clear = true])
 void removeAttribute (string $name)
 void setAttribute (string $name, string $value, [array $params = array()], [boolean $append = true], [array $values = false])
 boolean setParameter (string $name, [array $params = array()])
 array toHash ([boolean $paramsInKeys = false])
 void _exportDate (object|array $value, [string $autoconvert = false])
 void _exportDateTime ( $value)
 void _exportDuration ( $value)
 void _exportPeriod ( $value)
 void _exportTime ( $value)
 void _exportUtcOffset ( $value)
 string _exportvData ([string $base = 'VCALENDAR'])
 void _parseDateTime ( $text, [ $tzid = false])
 void _parseDuration ( $text)
 void _parsePeriod ( $text)
 void _parseTZID ( $date,  $time,  $tzid)
 void _parseUtcOffset ( $text)
 string _quotedPrintableEncode ([string $input = ''])
Variables
array $_attributes = array() (line 42)

The name/value pairs of attributes for this object (UID, DTSTART, etc.). Which are present depends on the object and on what kind of component it is.

array $_components = array() (line 49)

Any children (contained) iCalendar components of this object.

Horde_iCalendar $_container = false (line 33)

The parent (containing) iCalendar object.

string $_newline = "\r\n" (line 56)

According to RFC 2425, we should always use CRLF-terminated lines.

string $_version (line 64)

iCalendar format version (different behavior for 1.0 and 2.0 especially with recurring events).

Methods
static newComponent (line 83)

Return a reference to a new component.

  • return: to a Horde_iCalendar_* object as specified.
static object Reference &newComponent (string $type,  &$container, Horde_iCalendar $container)
  • string $type: The type of component to return
  • Horde_iCalendar $container: A container that this component will be associated with.
  • &$container
static _parseDate (line 1308)

Parses a Date field.

static void _parseDate ( $text)
  • $text
static _parseTime (line 1273)

Parses a Time field.

static void _parseTime ( $text)
  • $text
Constructor Horde_iCalendar (line 66)
Horde_iCalendar Horde_iCalendar ([ $version = '2.0'])
  • $version
addComponent (line 301)

Add a vCalendar component (eg vEvent, vTimezone, etc.).

void addComponent (Horde_iCalendar $component)
clear (line 434)

Clears the iCalendar object (resets the components and attributes arrays).

void clear ()
exportvCalendar (line 466)

Export as vCalendar format.

void exportvCalendar ()

Redefined in descendants as:
findComponent (line 382)

Locates the first child component of the specified class, and returns a reference to it.

  • return: False if no subcomponent of the specified class exists or a reference to the requested component.
boolean|Horde_iCalendar_* &findComponent ( $childclass, string $type)
  • string $type: The type of component to find.
  • $childclass
findComponentByAttribute (line 409)

Locates the first matching child component of the specified class, and returns a reference to it.

  • return: False if no matching subcomponent of the specified class exists, or a reference to the requested component.
boolean|Horde_iCalendar_* &findComponentByAttribute (string $childclass, string $attribute, [string $value = null])
  • string $childclass: The type of component to find.
  • string $attribute: This attribute must be set in the component for it to match.
  • string $value: Optional value that $attribute must match.
getAllAttributes (line 282)

Get attributes for all tags or for a given tag.

  • return: An array containing all the attributes and their types.
array getAllAttributes ([string $tag = false])
  • string $tag: Return attributes for this tag, or all attributes if not given.
getAttribute (line 192)

Get the value of an attribute.

  • return: (object) PEAR_Error if the attribute does not exist. (string) The value of the attribute. (array) The parameters for the attribute or multiple values for an attribute.
mixed getAttribute (string $name, [boolean $params = false])
  • string $name: The name of the attribute.
  • boolean $params: Return the parameters for this attribute instead of its value.
getAttributeDefault (line 253)

Returns the value of an attribute, or a specified default value if the attribute does not exist.

  • return: (string) The value of $name. (mixed) $default if $name does not exist.
mixed getAttributeDefault (string $name, [mixed $default = ''])
  • string $name: The name of the attribute.
  • mixed $default: What to return if the attribute specified by $name does not exist.
getAttributeValues (line 228)

Gets the values of an attribute as an array. Multiple values are possible due to:

a) multiplce occurences of 'name' b) (unsecapd) comma seperated lists.

So for a vcard like "KEY:a,b\nKEY:c" getAttributesValues('KEY') will return array('a', 'b', 'c').

  • return: (object) PEAR_Error if the attribute does not exist. (array) Multiple values for an attribute.
mixed getAttributeValues (string $name)
  • string $name: The name of the attribute.
getComponent (line 363)

Retrieve a specific component.

  • return: (boolean) False if the index does not exist. (Horde_iCalendar_*) The requested component.
mixed getComponent (integer $idx)
  • integer $idx: The index of the object to retrieve.
getComponentClasses (line 330)

Return the classes (entry types) we have.

  • return: Hash with class names Horde_iCalendar_xxx as keys and number of components of this class as value.
array getComponentClasses ()
getComponentCount (line 350)

Number of components in this container.

  • return: Number of components in this container.
integer getComponentCount ()
getComponents (line 314)

Retrieve all the components.

  • return: Array of Horde_iCalendar objects.
array getComponents ()
isOldFormat (line 449)

Checks if entry is vcalendar 1.0, vcard 2.1 or vnote 1.1.

These 'old' formats are defined by www.imc.org. The 'new' (non-old) formats icalendar 2.0 and vcard 3.0 are defined in rfc2426 and rfc2445 respectively.

  • since: Horde 3.1.2
void isOldFormat ()
parsevCalendar (line 523)

Parses a string containing vCalendar data.

  • return: True on successful import, false otherwise.
  • todo: This method doesn't work well at all, if $base is VCARD.
boolean parsevCalendar (string $text, [string $base = 'VCALENDAR'], [string $charset = null], [boolean $clear = true])
  • string $text: The data to parse.
  • string $base: The type of the base object.
  • string $charset: The encoding charset for $text. Defaults to utf-8 for new format, iso-8859-1 for old format.
  • boolean $clear: If true clears the iCal object before parsing.

Redefined in descendants as:
removeAttribute (line 264)

Remove all occurences of an attribute.

void removeAttribute (string $name)
  • string $name: The name of the attribute.
setAttribute (line 119)

Sets the value of an attribute.

void setAttribute (string $name, string $value, [array $params = array()], [boolean $append = true], [array $values = false])
  • string $name: The name of the attribute.
  • string $value: The value of the attribute.
  • array $params: Array containing any addition parameters for this attribute.
  • boolean $append: True to append the attribute, False to replace the first matching attribute found.
  • array $values: Array representation of $value. For comma/semicolon seperated lists of values. If not set use $value as single array element.
setParameter (line 166)

Sets parameter(s) for an (already existing) attribute. The parameter set is merged into the existing set.

  • return: True on success, false if no attribute $name exists.
boolean setParameter (string $name, [array $params = array()])
  • string $name: The name of the attribute.
  • array $params: Array containing any additional parameters for this attribute.
toHash (line 494)

Export this entry as a hash array with tag names as keys.

  • return: A hash array with tag names as keys.
array toHash ([boolean $paramsInKeys = false])
  • boolean $paramsInKeys: If false, the operation can be quite lossy as the parameters are ignored when building the array keys. So if you export a vcard with LABEL;TYPE=WORK:foo LABEL;TYPE=HOME:bar the resulting hash contains only one label field! If set to true, array keys look like 'LABEL;TYPE=WORK'
_exportDate (line 1332)

Exports a date field.

void _exportDate (object|array $value, [string $autoconvert = false])
  • object|array $value: Date object or hash.
  • string $autoconvert: If set, use this as time part to export the date as datetime when exporting to Vcalendar 1.0. Examples: '000000' or '235959'
_exportDateTime (line 1250)

Export a DateTime field.

void _exportDateTime ( $value)
  • $value
_exportDuration (line 1386)

Export a duration value.

void _exportDuration ( $value)
  • $value
_exportPeriod (line 1141)

Export a Time Period field.

void _exportPeriod ( $value)
  • $value
_exportTime (line 1293)

Exports a Time field.

void _exportTime ( $value)
  • $value
_exportUtcOffset (line 1110)

Export a UTC Offset field.

void _exportUtcOffset ( $value)
  • $value
_exportvData (line 828)

Export this component in vCal format.

  • return: vCal format data.
string _exportvData ([string $base = 'VCALENDAR'])
  • string $base: The type of the base object.
_parseDateTime (line 1207)

Parses a DateTime field and returns a unix timestamp. If the field cannot be parsed then the original text is returned unmodified.

  • todo: This function should be moved to Horde_Date and made public.
void _parseDateTime ( $text, [ $tzid = false])
  • $text
  • $tzid
_parseDuration (line 1347)

Parse a Duration Value field.

void _parseDuration ( $text)
  • $text
_parsePeriod (line 1125)

Parse a Time Period field.

void _parsePeriod ( $text)
  • $text
_parseTZID (line 1157)

Grok the TZID and return an offset in seconds from UTC for this date and time.

void _parseTZID ( $date,  $time,  $tzid)
  • $date
  • $time
  • $tzid
_parseUtcOffset (line 1091)

Parse a UTC Offset field.

void _parseUtcOffset ( $text)
  • $text
_quotedPrintableEncode (line 1440)

Converts an 8bit string to a quoted-printable string according to RFC 2045, section 6.7.

imap_8bit() does not apply all necessary rules.

  • return: The quoted-printable encoded string.
string _quotedPrintableEncode ([string $input = ''])
  • string $input: The string to be encoded.

Documentation generated on Sun, 30 Jan 2011 05:18:18 +0000 by phpDocumentor 1.4.3