qCal_Component

This is the class from which all other component classes inherit from. There are some component classes that have a lot of features on top of what comes from this class, and there are some that have almost no extra functionality. But either way, I would advise you read this section before reading about any of its descendents (qCal_Component_Vevent for instance).

Instantiation

qCal_Component is an abstract class, so it is not possible to instantiate it directly. You must use one of its descendants such as qCal_Component_Vevent. All of its descendants are instantiated exactly the same, so the following will be true for any of the component classes.

iCalendar components are basically just a collection of properties, and occasionally sub-components. So to instantiate a qCal_Component class, you can optionally provide an array of properties and an array of components. You can also instantiate the class with no parameters (and add them later using setters).

new qCal_Component( [ Array $properties [, Array $components ]] )

Parameters

properties

This parameter must be an array of keys and values or an array of qCal_Property objects.

Examples

Keys and Values

$event = new qCal_Component_Vevent(array(
    'summary' => "Luke's birthday party",
    'dtstart' => "2009-04-23 20:00:00",
));

List of property objects

$event = new qCal_Component_Vevent(array(
    new qCal_Property_Summary("Luke's birthday party"),
    new qCal_Property_Dtstart("2009-04-23 20:00:00"),
));

Intermixed

$event = new qCal_Component_Vevent(array(
    'summary' => "Luke's birthday party",
    new qCal_Property_Dtstart("2009-04-23 20:00:00")
));

components

This parameter must be an array of keys and values or an array of qCal_Component objects.

Examples

Keys and Values

$event = new qCal_Component_Vevent(array(
    'summary' => "Luke's birthday party",
    'dtstart' => "2009-04-23 20:00:00",
));

List of property objects

$event = new qCal_Component_Vevent(array(
    new qCal_Property_Summary("Luke's birthday party"),
    new qCal_Property_Dtstart("2009-04-23 20:00:00"),
));

Intermixed

$event = new qCal_Component_Vevent(array(
    'summary' => "Luke's birthday party",
    new qCal_Property_Dtstart("2009-04-23 20:00:00")
));
 
/home/luke/dokuwiki/data/pages/qcal_component.txt · Last modified: 2010/01/19 14:12 by luke
 
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.2
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki