Overview

Packages

  • Icalendar

Classes

  • Horde_Icalendar
  • Horde_Icalendar_Daylight
  • Horde_Icalendar_Exception
  • Horde_Icalendar_Standard
  • Horde_Icalendar_Translation
  • Horde_Icalendar_Valarm
  • Horde_Icalendar_Vcard
  • Horde_Icalendar_Vevent
  • Horde_Icalendar_Vfreebusy
  • Horde_Icalendar_Vjournal
  • Horde_Icalendar_Vnote
  • Horde_Icalendar_Vtimezone
  • Horde_Icalendar_Vtodo
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Icalendar

Class representing iCalendar files.

Copyright 2003-2012 Horde LLC (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Direct known subclasses

Horde_Icalendar_Daylight, Horde_Icalendar_Standard, Horde_Icalendar_Valarm, Horde_Icalendar_Vcard, Horde_Icalendar_Vevent, Horde_Icalendar_Vfreebusy, Horde_Icalendar_Vjournal, Horde_Icalendar_Vnote, Horde_Icalendar_Vtimezone, Horde_Icalendar_Vtodo
Package: Icalendar
Category: Horde
License: LGPL 2.1
Author: Mike Cochrane mike@graftonhall.co.nz
Located at Horde/Icalendar.php
Methods summary
public
# __construct( mixed $version = '2.0' )

Constructor.

Constructor.

Var

string $version Version.
public static object
# newComponent( string $type, Horde_Icalendar $container )

Return a reference to a new component.

Return a reference to a new component.

Parameters

$type
The type of component to return
$container
<p>A container that this component will be associated with.</p>

Returns

object
Reference to a Horde_Icalendar_* object as specified.
public
# setVersion( string $version )

Sets the version of this component.

Sets the version of this component.

Parameters

$version
A float-like version string.

See

$version
$oldFormat
public
# setAttribute( string $name, string $value, array $params = array(), boolean $append = true, array $values = false )

Sets the value of an attribute.

Sets the value of an attribute.

Parameters

$name
The name of the attribute.
$value
The value of the attribute.
$params
<p>Array containing any addition parameters for this attribute.</p>
$append
<p>True to append the attribute, False to replace the first matching attribute found.</p>
$values
<p>Array representation of $value. For comma/semicolon seperated lists of values. If not set use $value as single array element.</p>
public boolean
# setParameter( string $name, array $params = array() )

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

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

Parameters

$name
The name of the attribute.
$params
<p>Array containing any additional parameters for this attribute.</p>

Returns

boolean
True on success, false if no attribute $name exists.
public mixed
# getAttribute( string $name, boolean $params = false )

Get the value of an attribute.

Get the value of an attribute.

Parameters

$name
The name of the attribute.
$params
<p>Return the parameters for this attribute instead of its value.</p>

Returns

mixed

(string) The value of the attribute. (array) The parameters for the attribute or multiple values for an attribute.

Throws

Horde_Icalendar_Exception
public array
# getAttributeValues( string $name )

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

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

a) multiple 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').

Parameters

$name
The name of the attribute.

Returns

array
Multiple values for an attribute.

Throws

Horde_Icalendar_Exception
public mixed
# getAttributeDefault( string $name, mixed $default = '' )

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

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

Parameters

$name
The name of the attribute.
$default
<p>What to return if the attribute specified by $name does not exist.</p>

Returns

mixed

(string) The value of $name. (mixed) $default if $name does not exist.

public
# removeAttribute( string $name )

Remove all occurences of an attribute.

Remove all occurences of an attribute.

Parameters

$name
The name of the attribute.
public array
# getAllAttributes( string $tag = false )

Get attributes for all tags or for a given tag.

Get attributes for all tags or for a given tag.

Parameters

$tag
<p>Return attributes for this tag, or all attributes if not given.</p>

Returns

array
An array containing all the attributes and their types.
public
# addComponent( mixed $components )

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

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

Parameters

$components
<p>a Horde_Icalendar component (subclass) or an array of them.</p>
public array
# getComponents( )

Retrieve all the components.

Retrieve all the components.

Returns

array
Array of Horde_Icalendar objects.
public TODO
# getType( )

TODO

TODO

Returns

TODO
public array
# getComponentClasses( )

Return the classes (entry types) we have.

Return the classes (entry types) we have.

Returns

array

Hash with class names Horde_Icalendar_xxx as keys and number of components of this class as value.

public integer
# getComponentCount( )

Number of components in this container.

Number of components in this container.

Returns

integer
Number of components in this container.
public mixed
# getComponent( integer $idx )

Retrieve a specific component.

Retrieve a specific component.

Parameters

$idx
The index of the object to retrieve.

Returns

mixed

(boolean) False if the index does not exist. (Horde_Icalendar_*) The requested component.

public boolean|Horde_Icalendar_*
# findComponent( string $childclass )

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

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

Parameters

$childclass
$type The type of component to find.

Returns

boolean|Horde_Icalendar_*

False if no subcomponent of the specified class exists or the requested component.

public boolean|Horde_Icalendar_*
# findComponentByAttribute( string $childclass, string $attribute, string $value = null )

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

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

Parameters

$childclass
The type of component to find.
$attribute
<p>This attribute must be set in the component for it to match.</p>
$value
Optional value that $attribute must match.

Returns

boolean|Horde_Icalendar_*

False if no matching subcomponent of the specified class exists, or the requested component.

public
# clear( )

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

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

public TODO
# exportvCalendar( )

Export as vCalendar format.

Export as vCalendar format.

Returns

TODO
public array
# toHash( boolean $paramsInKeys = false )

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

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

Parameters

$paramsInKeys
<p>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'</p>

Returns

array
A hash array with tag names as keys.
public boolean
# parsevCalendar( string $text, string $base = 'VCALENDAR', boolean $clear = true )

Parses a string containing vCalendar data.

Parses a string containing vCalendar data.

Parameters

$text
The data to parse.
$base
The type of the base object.
$clear
If true clears this object before parsing.

Returns

boolean
True on successful import, false otherwise.

Throws

Horde_Icalendar_Exception
public TODO
# _exportUtcOffset( mixed $value )

Export a UTC Offset field.

Export a UTC Offset field.

Parameters

$value
TODO

Returns

TODO
public TODO
# _parseDateTime( mixed $text, mixed $tzid = false )

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

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

Parameters

$text
TODO
$tzid
TODO

Returns

TODO
public string
# _exportDateTime( integer|object|array $value, boolean $floating = false )

Export a DateTime field.

Export a DateTime field.

Parameters

$value
<p>The time value to export (either a Horde_Date, array, or timestamp).</p>
$floating
<p>Whether to return a floating date-time (without time zone information). @since Horde_Icalendar 1.0.5.</p>

Returns

string
The string representation of the datetime value.
public array
# _parseDate( mixed $text )

Parses a Date field.

Parses a Date field.

Parameters

$text
TODO

Returns

array
TODO
Properties summary
public string $type

The component type of this class.

The component type of this class.

# 'vcalendar'
API documentation generated by ApiGen