iCalcreator 2.6
iCalcreator class v2.6iCalcreator is a PHP class managing iCal formatted files for non-calendar systems like CMS, project management systems and other applications able to process calendar information like agendas, tasks, reports, totos, journaling data and for communication with calendar systems and applications.
iCalcreator features create, parse, edit and select calendar and calendar components.
iCalcreator is built of a single class file with a simple interface and are calendar component property oriented. Development environment is PHP version 5.x but coding is done to meet 4.x backward compability.
A short iCal description is found at Wikipedia. If You are not familiar with iCal, read this first!
Knowledge of calendar protocol rfc2445/rfc2446 is to recommend;
rfc2445
- Internet Calendaring and Scheduling Core Object Specification (iCalendar)
rfc2446
- iCalendar Transport-Independent Interoperability Protocol (iTIP) Scheduling Events, BusyTime, To-dos and Journal Entries.
Get RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format, RFC2446 - iCalendar Transport-Independent Interoperability Protocol (iTIP) Scheduling Events, BusyTime, To-dos and Journal Entries in text format.
All iCalcreator functions calls are made as simple as possible BUT (, !!!,) read these rfc's properly! xCal (iCal xml) output format is supported but still experimental.
This style is used for formats.
This style is used for PHP coding examples. // this style is used for coding comments.
This style is used for content details.
This style is used for RFC2445 quotes.
Example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setProperty( "x-wr-calname", "Calendar Sample" ); $vcalendar->setProperty( "X-WR-CALDESC", "Calendar Description" ); $vcalendar->setProperty( "X-WR-TIMEZONE", "Europe/Stockholm" ); .. .
Download iCalcreator coding samples.
Examples how to employ iCalcreator in software development:
The iCal file event editor and
tinycal, calendar-in-a-box.
There are free iCal/xCal icons in the images directory, to use as buttons on a webpage.
The command coding examples are only examples, recommendation is to use a coding standard, the following, incomplete, list is a good start; http://www.dagbladet.no/development/phpcodingstandard/ http://ez.no/ezpublish/documentation/development/standards/php http://framework.zend.com/manual/en/coding-standard.html http://gforge.org/docman/view.php/1/2/coding-standards.html http://pear.php.net/manual/en/standards.phprequire_once [folder/]iCalcreator.class.php;
to your php-script.icalobject = 1*("BEGIN" ":" "VCALENDAR" CRLF
icalbody
"END" ":" "VCALENDAR" CRLF)
"prodid" and "version" are both REQUIRED, but MUST NOT occur more than once
prodid / version /
"calscale"and "method"are optional, but MUST NOT occur more than once
)component = 1*(eventc / todoc / journalc / freebusyc / timezonec / iana-comp* / x-comp*)
iana-comp = "BEGIN" ":" iana-token CRLF
1*contentline
"END" ":" iana-token CRLF
x-comp = "BEGIN" ":" x-name CRLF
1*contentline
"END" ":" x-name CRLF
*) not supported by iCalcreator"BEGIN" ":" "VEVENT" CRLF
eventprop *alarmc
"END" ":" "VEVENT" CRLF
eventprop = *(the following are optional,but MUST NOT occur more than once
class / created / description / dtstart /
geo / last-mod / location / organizer / priority /
dtstamp / seq / status / summary /
transp / uid / url / recurid /
either "dtend" or "duration" may appear in a "eventprop",
but "dtend" and "duration" MUST NOT occur in the same "eventprop"
the following are optional, and MAY occur more than once
attach / attendee / categories / comment /
contact / exdate / exrule / rstatus /
related / resources / rdate / rrule / x-prop
)"BEGIN" ":" "VTODO" CRLF
todoprop *alarmc
"END" ":" "VTODO" CRLF
todoprop = *(the following are optional, but MUST NOT occur more than once
class / completed / created / description / dtstamp / dtstart /
geo / last-mod / location / organizer / percent / priority /
recurid / seq / status / summary /uid / url /
either "due" or "duration" may appear in a "todoprop",
but "due" and "duration" MUST NOT occur in the same "todoprop"
the following are optional,and MAY occur more than once
attach / attendee / categories / comment /
contact / exdate / exrule / rstatus /
related / resources / rdate / rrule / x-prop
)journalc = "BEGIN" ":" "VJOURNAL" CRLF
jourprop
"END" ":" "VJOURNAL" CRLF
jourprop = *(the following are optional, but MUST NOT occur more than once
class / created / description / dtstart /
dtstamp / last-mod / organizer / recurid /
seq / status / summary /uid / url /
the following are optional,and MAY occur more than once
attach / attendee / categories / comment /
contact / exdate / exrule / related /
rdate / rrule / rstatus / x-prop
)"BEGIN" ":" "VFREEBUSY" CRLF
fbprop
"END" ":" "VFREEBUSY" CRLF
fbprop = *(the following are optional, but MUST NOT occur more than once
contact / dtstart / dtend / duration /
dtstamp / organizer / uid / url /
the following are optional,and MAY occur more than once
attendee / comment / freebusy / rstatus / x-prop
)"BEGIN" ":" "VALARM" CRLF
(audioprop / dispprop / emailprop / procprop)
"END" ":" "VALARM" CRLF
audioprop = 2*("action" and "trigger" are both REQUIRED, but MUST NOT occur more than once
"duration" and "repeat" are both optional,and MUST NOT occur more than once each,
but if one occurs, so MUST the other
the following is optional, but MUST NOT occur more than once
attach /
the following is optional, and MAY occur more than once
)the following are all REQUIRED, but MUST NOT occur more than once
action / description / trigger /
"duration" and "repeat" are both optional,and MUST NOT occur more than once each,
but if one occurs, so MUST the other
the following is optional, and MAY occur more than once
)the following are all REQUIRED, but MUST NOT occur more than once
action / description / trigger / summary
the following is REQUIRED, and MAY occur more than once
attendee /
"duration" and "repeat" are both optional, and MUST NOT occur more than once each,
but if one occurs, so MUST the other
the following are optional, and MAY occur more than once
)the following are all REQUIRED, but MUST NOT occur more than once
"duration" and "repeat" are both optional, and MUST NOT occur more than once each,
but if one occurs, so MUST the other
"description" is optional, and MUST NOT occur more than once
the following is optional, and MAY occur more than once
)"BEGIN" ":" "VTIMEZONE" CRLF
2*("tzid" is required, but MUST NOT occur more than once
tzid /
"last-mod" and "tzurl" are optional, but MUST NOT occur more than once
one of "standardc" or "daylightc" MUST occur and each MAY occur more than once.
standardc / daylightc /
the following is optional, and MAY occur more than once
)"END" ":" "VTIMEZONE" CRLF
standardc = "BEGIN" ":" "STANDARD" CRLF
tzprop
"END" ":" "STANDARD" CRLF
daylightc = "BEGIN" ":" "DAYLIGHT" CRLF
tzprop
"END" ":" "DAYLIGHT" CRLF
the following are each REQUIRED, but MUST NOT occur more than once
dtstart / tzoffsetto / tzoffsetfrom /
the following are optional, and MAY occur more than once
comment /rdate / rrule / tzname / x-prop
)| 0-1 | OPTIONAL property, MUST NOT occur more than once. | |||||||
| 0-m | OPTIONAL property, MAY occur more than once. | |||||||
| 0 or 1=1 | A pair of OPTIONAL properties, MUST NOT occur more than once each. If one occurs, so MUST the other |
|||||||
| 0*1 | A pair of OPTIONAL properties, MUST NOT occur more than once each. If one occurs, so MUST NOT the other |
|||||||
| 1-m | REQUIRED property, MAY occur more than once. | |||||||
| 1 | REQUIRED property, MUST NOT occur more than once. | |||||||
| vevent | vtodo | vjournal | vfreebusy | valarm | ||||
| audio | display | procedure | ||||||
| action | 1 | 1 | 1 | 1 | ||||
| attach | 0-m | 0-m | 0-m | 0-1 | 0-m | 1 | ||
| attendee | 0-m | 0-m | 0-m | 0-m | 1-m | |||
| categories | 0-m | 0-m | 0-m | |||||
| class | 0-1 | 0-1 | 0-1 | |||||
| comment | 0-m | 0-m | 0-m | 0-m | ||||
| compleated | 0-1 | |||||||
| contact | 0-m | 0-m | 0-m | 0-1 | ||||
| created | 0-1 | 0-1 | 0-1 | |||||
| description | 0-1 | 0-1 | 0-m | 1 | 1 | 0-1 | ||
| dtend | 0*1 | 0-1 | ||||||
| dtstamp | 0-1 | 0-1 | 0-1 | 0-1 | ||||
| dtstart | 0-1 | 0-1 | 0-1 | 0-1 | ||||
| due | 0*1 | |||||||
| duration | 0*1 | 0*1 | 0-1 | 0 or 1=1 | 0 or 1=1 | 0 or 1=1 | 0 or 1=1 | |
| exdate | 0-m | 0-m | 0-m | |||||
| exrule | 0-m | 0-m | 0-m | |||||
| freebusy | 0-m | |||||||
| geo | 0-1 | 0-1 | ||||||
| last-mod | 0-1 | 0-1 | 0-1 | |||||
| location | 0-1 | 0-1 | ||||||
| organizer | 0-1 | 0-1 | 0-1 | 0-1 | ||||
| percent | 0-1 | |||||||
| priority | 0-1 | 0-1 | ||||||
| rdate | 0-m | 0-m | 0-m | |||||
| recurid | 0-1 | 0-1 | 0-1 | |||||
| related | 0-m | 0-m | 0-m | |||||
| repeat | 0 or 1=1 | 0 or 1=1 | 0 or 1=1 | 0 or 1=1 | ||||
| resources | 0-m | 0-m | ||||||
| rrule | 0-m | 0-m | 0-m | |||||
| rstatus | 0-m | 0-m | 0-m | 0-m | ||||
| sequence | 0-1 | 0-1 | 0-1 | |||||
| status | 0-1 | 0-1 | 0-1 | |||||
| summary | 0-1 | 0-1 | 0-1 | 1 | ||||
| transp | 0-1 | |||||||
| trigger | 1 | 1 | 1 | 1 | ||||
| uid | 0-1 | 0-1 | 0-1 | 0-1 | ||||
| url | 0-1 | 0-1 | 0-1 | 0-1 | ||||
| x-prop | 0-m | 0-m | 0-m | 0-m | 0-m | 0-m | 0-m | 0-m |
If not set, DTSTART and UID are created automatic by iCalcreator for vevent, vtodo, vjournal and vfeebusy components when using calendar functions saveCalendar or returnCalendar or when fetching DTSTART/UID property value with component function getProperty.
Format
vcalendar()
Example
$calendar = new vcalendar();// initiate new CALENDAR
Format
vevent()
Example
$vevent = new vevent(); // initiate EVENT
Format
vtodo()
Example
$vtodo = new vtodo(); // initiate TODO
Format
vjournal()
Example
$vjournal = new vjournal(); // initiate JOURNAL
Format
vfreebusy()
Example
$vfreebusy = new vfreebusy(); // initiate FREEBUSY
Format
valarm()
Example
$valarm = new valarm(); // initiate ALARM
Format
vtimezone()
Example
$vtimezone = new vtimezone(); // initiate TIMEZONE
Format
deleteProperty( [ string PropName [, int order=1 ] )
Propname - case independent, strict rfc2445 component property names, unknown/missing Propname will be regarded as X-property. order - if missing 1st/next occurence, used with multiply (property) occurences
Example 1
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); if( !$vcalendar->deleteProperty( "method" )) echo "METHOD property not found"; .. .
Format
getProperty( [ string PropName [, int order=1 [, bool complete=FALSE ]]] )
Propname - case independent, strict rfc2445 component property names, unknown/missing Propname will be regarded as X-property. order - if missing 1st/next occurence, used with multiply (property) occurences complete - FALSE (default) : output only property value - TRUE : output = array("value"=> <value> ,"params" => <parameter array>)
Example 1
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); $calscale = $vcalendar->getProperty( "calscale" ); .. .
Example 2
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); while( $xprop = $vcalendar->getProperty( )) { // get x-properties in order.. . .. .
Format
setProperty( string PropName, mixed Proparg_1 *[, mixed Proparg_n] )
Propname case independent, strict rfc2445 calendar property names, unknown Propname will be regarded as X-property.Example
$vcalendar = new vcalendar(); // initiate new CALENDAR $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setProperty( "calscale", "GREGORIAN" );
Format
getProperty( "calscale" )
Example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); $calscale = $vcalendar->getProperty( "calscale" ); .. .
Format
setProperty( "calscale", string value )
Example
$vcalendar = new vcalendar(); // initiate new CALENDAR $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setProperty( "calscale", "GREGORIAN" ); .. .
Format
getProperty( "method" );
Example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); $method = $vcalendar->getProperty( "method" ) .. .
Format
setProperty( "method", string value )
Example
$vcalendar = new vcalendar(); // initiate new CALENDAR $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setProperty( "method", "PUBLISH" )
Format
getProperty( "version" )
Example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); $version = $vcalendar->getProperty( "version" ) .. .
Format
setProperty( "version", string version )
Example
$vcalendar = new vcalendar(); // initiate new CALENDAR $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setProperty( "version", "2.0" )
Format
deleteProperty( "<X-PROPERTY>" )
Example 1
$vcalendar->deleteProperty( "<X-PROPERTY>" );
Example 2
Deleting all x-properties.while( $vcalendar->deleteProperty()) continue;
Format
getProperty()
getProperty( "<X-PROPERTY>" )
output = array( propertyName1, propertyData2 )
getProperty( FALSE, propOrderNo/FALSE, TRUE )
output = array( propertyName1 , array( "value" => propertyData2 ) , "params" => params 3))
Example 1
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); while( $xprop = $vcalendar->getProperty( )) { //read all x-props in a loop .. .
$xprop = array( propertyName1, propertyData2 )
Example 2
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); if( $xprop = $vcalendar->getProperty( "X-WR-TIMEZONE" )) { //if exists, read X-WR-TIMEZONE x-prop .. .
$xprop = array( "X-WR-TIMEZONE", propertyData2 )
Example 3
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); while( $xprop = $vcalendar->getProperty( FALSE, FALSE, TRUE )) { .. .
$xprop = array( propertyName1 , array( "value " => propertyData2 ) , "params "=> params 3 )
Format
setProperty( propertyName, propertyData [, params ] )
propertyName1 = Any property name with a "X-" prefix propertyData2 = Value type TEXT params3 = array( ["LANGUAGE" => "<lang>"] [, xparam] ) xparam = *[ xparamkey => xparamvalue ] propOrderNo = int ordernumber, 1=1st, 2=2nd etc
Example
$vcalendar = new vcalendar(); // initiate new CALENDAR $vcalendar->setConfig( "unique_id", "domain.com" ); // set some X-properties.. . $vcalendar->setProperty( "x-wr-calname", "Calendar Sample" ) $vcalendar->setProperty( "X-WR-CALDESC", "Calendar Description" ); $vcalendar->setProperty( "X-WR-TIMEZONE", "Europe/Stockholm" );
format 1
Remove component with order number (1st=1, 2nd=2.. .).deleteComponent( int orderNumber )
format 2
Remove component with component type (e.g. "vevent") and order 1 alt. suborder number.deleteComponent( string componentType [, int componentSuborderNumber])
format 3
Remove component with UID. N.B UID is NOT set for ALARM / TIMEZONE components.deleteComponent( string UID )
Example 1
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); $vcalendar->deleteComponent( 1 ); $vcalendar->deleteComponent( "vtodo", 2 ); $vcalendar->deleteComponent( "20070803T194810CEST-0123U3PXiX@domain.com"); .. .
Example 2
Deleting all components, using format 2 without order number.$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); .. . while( $vcalendar->deleteComponent( "vevent")) continue; .. . $vtodo = $vcalendar->getComponent( 'vtodo' ); while( $vtodo->deleteComponent( "valarm")) continue; .. .
format 1
Get next component, until end-of-components.getComponent()
format 2
Get component with order number (1st=1, 2nd=2.. .).getComponent( int orderNumber )
format 3
Get (next) component with component type (until end-of-components) alt. get component with component type and suborder number (1st=1, 2nd=2.. .).getComponent( string componentType [, int componentSuborderNumber])
format 4
Get component with UID as key. N.B UID is NOT set for ALARM / TIMEZONE components.getComponent( string UID )
Example 1
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); while( $comp = $vcalendar->getComponent()) { .. . } .. .
Example 2
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); if( $comp = $vcalendar->getComponent( 1 )) { .. . } .. .
Example 3
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); if( $comp = $vcalendar->getComponent( "vtodo", 2 ) { .. . } .. .
Example 4
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); $uid = "20070803T194810CEST-0123U3PXiX@domain.com"; if($comp = $vcalendar->getComponent( $uid ){ .. . } .. .
Format
selectComponents([int startYear, int startMonth, int startDay [, int endYear, int endMonth, int endDay [, mixed cType [, bool flat [, bool any [, bool split]]]]]])
Returns an array with components (events.. .). For all recurrence instances of a calendar component, an x-property, "x-current-dtstart" and opt. also "x-current-dtend" alt. "x-current-due", has been created with a TEXT content, "Y-m-d [H:i:s][timezone/UTC offset]" showing the current start and opt. also end alt. due date.startYear : start year of date period (4*digit), default current year startMonth : start month of date period (1-2*digit), def. current month startDay : start day of date period (1-2*digit), def. current day endYear : end year of date period (4*digit), def. startYear endMonth : end month of date period (-2*digit), def. startMonth endDay : end day of date period (1-2*digit), def. StartDay cType : calendar component type(-s), default (FALSE) all else string/array type(-s) (vevent, vtodo, vjournal, vfreebusy) flat : FALSE (default) => output : array[Year][Month][Day][] TRUE => output : array[] (ignores split) any : TRUE (default) - select component that occurs within period FALSE - only components that starts (DTSTART) within period split : TRUE - (default) one component copy for every day it occurs within the period (implies flat=FALSE) FALSE - one occurance of component in output array, start date/recurrence date
Example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "directory", "import" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); $vcalendar->sort(); $events_arr = $vcalendar->selectComponents( 2007,11,1,2007,11,30,'vevent'); // select all events occuring 1-30 nov. 2007 foreach( $events_arr as $year => $year_arr ) { foreach( $year_arr as $month => $month_arr ) { foreach( $month_arr as $day => $day_arr ) { foreach( $day_arr as $event ) { $currddate = $event->getProperty( 'x-current-dtstart' ); // if member of a recurrence set,returns // array('x-current-dtstart' // , <(string) date("Y-m-d [H:i:s][timezone/UTC offset]")>) $startdate = $event->getProperty( 'dtstart' ); $summary = $event->getProperty( 'summary' ); $description = $event->getProperty( 'description' ); .. .
format 1
Insert last in component chain.setComponent( component ) addComponent( component ) // alias
addComponent, may be removed i future versions.
format 2
Replace component with order number (1st=1, 2nd=2.. .). If orderNumber is not found, component is inserted last in chain.setComponent( component, int orderNumber )
format 3
Replace component with component type and 1st alt. component order number. If orderNumber is not found, component is inserted last in chain.setComponent( component, string componentType [,int component suborder no])
format 4
Replace component with UID. N.B UID is NOT set for ALARM / TIMEZONE components. If UID is not found, component is inserted last in chain.setComponent( component, string UID )
Example
$vcalendar = new vcalendar(); //initiate new CALENDAR $vcalendar->setConfig( "unique_id", "domain.com" ); .. . $vevent = new vevent(); //initiate EVENT $vevent->setProperty( "dtstart" //add an EVENT property , 2006, 12, 24, 19, 30, 00 ); $vevent->setProperty(.. . .. . $vcalendar->setComponent( $vevent ); //add EVENT to calendar .. .
Format
parse( [ string filename ] )
Parameter for filename (including path/directory(!)), may be removed in future versions. Recommendation is to use setConfig, se example below.
parse example 1
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); .. .
parse example 2
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig("url", "http://www.ical.net/calendars/calendar.ics"); $vcalendar->parse(); .. .
merge example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "directory", "import" ); $vcalendar->setConfig( "filename", "file1.ics" ); $vcalendar->parse(); $vcalendar->setConfig( "filename", "file2.ics" ); $vcalendar->parse(); $vcalendar->sort(); $vcalendar->setConfig( "directory", "export" ); $vcalendar->setConfig( "filename", "icalmerge.ics" ); $vcalendar->saveCalendar(); .. .
Format
createCalendar()
Example
.. . $str = $calendar->createCalendar(); echo $str;
Format
returnCalendar()
Example 1
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); .. . $vevent = new vevent(); $vevent->setProperty( "dtstart", array( "year" => 2007 , "month" => 4 , "day" => 1 , "hour" => 19 )); $vevent->setProperty( "duration", 0, 0, 3 )); $vevent->setProperty( "LOCATION", "Central Placa" ); $vevent->setProperty( "summary", "PHP summit" ); .. . $vcalendar->setComponent( $vevent ); .. . $vcalendar->returnCalendar();
Example 2
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "directory", "depot" ); $vcalendar->setConfig( "filename", "calendar.ics" ); $vcalendar->parse(); $vcalendar->returnCalendar();
Format
saveCalendar ( string directory/FALSE [, string filename/FALSE [, string delimiter/FALSE ]] )
Parameters for directory/filename/delimeter, kept for backward compatibility, may be removed i future versions. Recommendation is to use setConfig, se example below.
Example
.. . $calendar->setConfig( "directory", "depot" ); $calendar->setConfig( "filename", "calendar.ics" ); $result = $calendar->saveCalendar(); if( !$result ) echo "error when saving.. ."
Format
sort()
Example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "directory", "depot" ); $vcalendar->setConfig( "filename", "calendar.ics" ); $vcalendar->parse(); $vcalendar->sort(); $vcalendar->returnCalendar();
Format
useCachedCalendar( [ int timeout ] ) useCachedCalendar( string directory/FALSE , string filename/FALSE , string delimiter/FALSE [, int timeout ] )
timeout : default 3600 sec Second format with parameters for directory/filename/delimeter, kept for backward compatibility, may be removed i future versions. Recommendation is to use setConfig, se example below.
Example
.. . $calendar->setConfig( "directory", "depot" ); $calendar->setConfig( "filename", "calendar.ics" ); $calendar->useCachedCalendar();
Format
setConfig( "allowEmpty", bool <directive> )
Example
$calendar->setConfig( "allowEmpty", TRUE );
Format
getConfig( "compsinfo" )
Output = array ( *compinfo ) compinfo = array ( "ordno" => int ordno, // order number (1st=1, 2nd=2..) , "type" => string type // component type (vevent, vtodo.. . , "uid" => string uid // component UID (not for ALARM / TIMEZONE) , "props" => array( *[ propertyName => Property count ]) // for every set property , "sub" => array( *compinfo )) // if subcomponents exists, an array for each subcomponent
Example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "directory", "depot" ); $vcalendar->setConfig( "filename", "calendar.ics" ); $vcalendar->parse(); $compsinfo = $vcalendar->getConfig( "compsinfo" ); foreach( $compsinfo as compinfo) { echo " order number : ".$compinfo["ordno"]; echo " type : ".$compinfo["type"]; echo " UID : ".$compinfo["uid"]; foreach( $compinfo["props"] as $propertyName => $propertyCount ) echo " $propertyName = $propertyCount"; if( is_array( $compinfo["sub"] )) { foreach( $compinfo["sub"] as $subcompinfo ) { echo " order number : ".$subcompinfo["ordno"]; /* .. dito if subcomponents exists .. . */ } } }
Format
getConfig( "delimiter" )
Example
$del = $calendar->getConfig( "delimiter" );
Format
setConfig( "delimiter", string <delimiter> )
Example
$calendar->setConfig( "delimiter", "/" );
Format
getConfig( "directory" )
Example
$folder = $calendar->getConfig( "directory" );
Format
setConfig( "directory", string <directory> )
Example
$calendar->setConfig( "directory", "depot" );
Format
getConfig( "fileinfo" )
Example
$fileinfo = $calendar->getConfig( "fileinfo" );
output = array( <directory>, <filename>, <filesize> )
$filename = date( "YmdHis" ).".ics";
$filename = date( "YmdHis" ).".xml"; // if format set to "xcal"
Format
getConfig( "filename" )
Example
$filename = $calendar->getConfig( "filename" );
Format
setConfig( "filename", string <filename> )
Example
$calendar->setConfig( "filename", "calendar.ics" );
Format
getConfig( "filesize" )
Example
$filesize = $calendar->getConfig( "filesize" );
Format
getConfig( "format" )
Example
$format = $calendar->getConfig( "format" );
Format
setConfig( "format", string <format> )
Example
$calendar->setConfig( "format", "xcal" );
Format
getConfig( "language" )
Example
$lang = $calendar->getConfig( "language" );
Format
setConfig( "language", string <lang> )
Example
$calendar->setConfig( "lang", "en" );
Format
getConfig( "newlinechar" ) getConfig( "nl" ) // alias
Example
$nl = $calendar->getConfig( "nl" );
Format
setConfig( "newlinechar", string <char> ) setConfig( "nl", string <char> ) // alias
Example
$calendar->setConfig( "nl", "\n" );
RFC2445: * The identifier is RECOMMENDED to be the identical syntax to the * [RFC 822] addr-spec. A good method to assure uniqueness is to put the * domain name or a domain literal IP address of the host on which.. .
Default AUTO generated, PHP: gethostbyname( $_SERVER["SERVER_NAME"] ) when running in a web server environment or "localhost" when doing command line execution. Can to be used to set other domain name than server name.
Format
getConfig( "unique_id" )
Example
$id = $calendar->getConfig( "unique_id" );
Format
setConfig( "unique_id", string <unique-Id> )
Example
$vcalendar = new vcalendar(); // initiate new CALENDAR $vcalendar->setConfig( "unique_id", "domain.com" ); .. .
Format
getConfig( "url" )
Example
$url = $calendar->getConfig( "URL" );
Format
setConfig( "URL", string <url> )
Example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "url", "http://www.iCal.net/depot/calendar.ics" ); $vcalendar->parse(); $vcalendar->sort(); .. . .. . $vcalendar->setConfig( "directory", "depot" ); $vcalendar->saveCalendar(); // local save i "depot" folder, same filename
All calendar component property functions for get/set data.
For property format in detail, see
RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text
and HTML format.
RFC2445: The date with UTC time, or absolute time, is identified by a LATIN CAPITAL LETTER Z suffix character (US-ASCII decimal 90), the UTC designator, appended to the time value. For example, the following represents January 19, 1998, at 0700 UTC:
DTSTART:19980119T070000Z
The TZID property parameter MUST NOT be applied to DATE-TIME properties whose time values are specified in UTC.
Notice: date limitation.
Due to limitation in PHP date commands, e.g. mktime, strtotime, a date (e.g. while setting DTSTART property) before "January 1 1970 00:00:00 GMT" can force a PHP date command to generate an error or set date to "January 1 1970".
Format
deleteProperty( [ string PropName [, int order=1 ] )
Propname - case independent, strict rfc2445 component property names, unknown/missing Propname will be regarded as X-property. order - if missing 1st/next occurence, used with multiply (property) occurences
Example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); $e = $vcalendar->getComponent( "vevent" ); while( $e->deleteProperty( "comment" )) continue; // remove all COMMENT properties .. .
Format
getProperty( string PropName [, int order=1 [, bool complete=FALSE ]] )
Propname - case independent, strict rfc2445 component property names, unknown/missing Propname will be regarded as X-property. order - if missing/FALSE 1st/next occurence, otherwise with multiply occurences (1st=1, 2nd=2.. .) complete - FALSE (default) : output only property value TRUE : output = array("value" => <value> ,"params"=> <parameter array>)
Example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); while( $vevent = $vcalendar->getComponent( "vevent" )) { $dtstart = $vevent->getProperty( "dtstart" ); // one occurence $description = $vevent->getProperty( "description" ); // one occurence while( $comment = $vevent->getProperty( "comment" )) { // MAY occur more than once .. . } .. .
Format
parse( mixed propertyText )
propertyText = string/array, strict rcf2445 formatted property/properties, property name must begin (first) line
example
.. . $e = new vevent(); $e->parse( 'DTSTAMP:19970324T1200Z' ); $e->parse( 'SEQUENCE:0' ); $e->parse( 'ORGANIZER:MAILTO:jdoe@host1.com' ); $e->parse( array( 'ATTENDEE;RSVP=TRUE:MAILTO:jsmith@host1.com', 'ATTENDEE;RSVP=TRUE:MAILTO:jsmith@host2.com', 'ATTENDEE;RSVP=TRUE:MAILTO:jsmith@host3.com', 'ATTENDEE;RSVP=TRUE:MAILTO:jsmith@host4.com' )); $e->parse( 'DTSTART:19970324T123000Z' ); $e->parse( 'DTEND:19970324T210000Z' ); $e->parse( 'CATEGORIES:MEETING,PROJECT' ); $e->parse( 'CLASS:PUBLIC' ); $e->parse( 'SUMMARY:Calendaring Interoperability Planning Meeting' ); $e->parse( 'STATUS:DRAFT' ); $e->parse( array( 'DESCRIPTION:Project xyz Review Meeting Minutes\n' ,' Agenda\n1. Review of project version 1.0 requirements.\n2.' ,'Definition' ,' of project processes.\n3. Review of project schedule.\n' ,'Participants: John Smith, Jane Doe, Jim Dandy\n-It was' ,' decided that the requirements need to be signed off by' ,' product marketing.\n-Project processes were accepted.\n ' ,'-Project schedule needs to account for scheduled holidays' ,' and employee vacation time. Check with HR for specific' ,' dates.\n-New schedule will be distributed by Friday.\n-' ,' Next weeks meeting is cancelled. No meeting until 3/23.' )); $e->parse( 'LOCATION:LDB Lobby' ); $e->parse( 'ATTACH;FMTTYPE=application/postscript:ftp://xyz.com/pub/conf/bkgrnd.ps' ); $e->parse( array( 'BEGIN:VALARM', 'ACTION:AUDIO', 'TRIGGER;VALUE=DATE-TIME:19970224T070000Z', 'ATTACH;FMTTYPE=audio/basic:http://host.com/pub/audio-files/ssbanner.aud', 'REPEAT:4', 'DURATION:PT1H', 'X-alarm:non-standard ALARM property', 'END:VALARM' )); $e->parse( 'X-xomment:non-standard property will be displayed, with comma escaped'); $calendar->setComponent( $e ); .. .
Format
setProperty( string PropName, mixed Proparg_1 *[, mixed Proparg_n] )
Propname case independent, strict rfc2445 component property names, unknown Propname will be regarded as X-property.
Example
$vevent = new vevent(); $vevent->setProperty( "dtstart" , array("year"=>2007,"month"=>4,"day"=>1,"hour"=>19)); $vevent->setProperty( "duration", 0, 0, 3 )); $vevent->setProperty( "LOCATION", "Central Placa" ); $vevent->setProperty( "summary", "PHP summit" ); .. .
Format
deleteProperty( "Action" )
Example
$valarm->deleteProperty( "Action" );
Format 1
getProperty( "Action" )
output = actionValue 1
Format 2
getProperty( "Action", FALSE , TRUE )
output = array( "value" => actionValue1 , "params" => xparam2 )
Example
$action = $valarm->getProperty( "action" );
Format
setProperty( "Action", actionValue [, xparam ] )
actionValue1 = one of "AUDIO" / "DISPLAY" / "EMAIL" / "PROCEDURE" xparam2 = array( *[ xparamkey => xparamvalue ] )
Example
$valarm->setProperty( "action", "DISPLAY" );
Format
deleteProperty( "ATTACH" )
Example 1
$valarm->deleteProperty( "ATTACH" );
Example 2
Delete ATTACH property no 2.$valarm->deleteProperty( "ATTACH", 2 );
Example 3
Deleting all ATTACH properties.while( $valarm->deleteProperty( "ATTACH" )) continue;
Format 1
getProperty( "Attach" )
output = attachValue1
Format 2
getProperty( "ATTACH", propOrderNo/FALSE , TRUE )
output = array( "value" => attachValue1 , "params" => params2 )
Format 3
getProperty( "Attach", propOrderNo )
Get propOrderNo ATTACH
Example
$attach = $valarm->getProperty( "attach" );
Format
setProperty( "attach", attachValue1 [, params [, propOrderNo ]] )
attachValue1 = URI / inline binary encoded content information. params2 = array( [ "ENCODING" => "BASE64", "VALUE" => "BINARY" ] [, "FMTTYPE" => contentType ] [, xparam ] ) contentType = The parameter value MUST be the TEXT for either an IANA registered content type or a non-standard content type. xparam = *[ xparamkey => xparamvalue ] propOrderNo = int ordernumber, 1=1st, 2=2nd etc
Example
$vevent->setProperty( "attach" , "ftp://domain.com/pub/docs/agenda.doc" , array( "FMTTYPE" => "application/binary" ));
Format
deleteProperty( "ATTENDEE" )
Example 1
$valarm->deleteProperty( "ATTENDEE" );
Example 2
Delete ATTENDEE property no 2.$valarm->deleteProperty( "ATTENDEE", 2 );
Example 3
Deleting all ATTENDEE properties.while( $valarm->deleteProperty( "ATTENDEE" )) continue;
Format 1
getProperty( "Attendee" )
output = attendeeValue 1
Format 2
getProperty( "ATTENDEE", propOrderNo/FALSE , TRUE )
output = array( "value" => attendeeValue1 , "params" => array( params2 ))
Format 3
getProperty( "ATTENDEE", propOrderNo )
Get propOrderNo ATTENDEE
Example
$attendee = $valarm->getProperty( "attendee" );
Format
setProperty( "attendee", attendeeValue [, params [, propOrderNo ]] )
attendeeValue1 = a calendar user address, a URI as defined by [RFC 1738] or any other IANA registered form for a URI. params2 = array( [CUTYPE] [,MEMBER] [,ROLE] [,PARTSTAT] [,RVSP] [,DELEGATED-TO] [,DELEGATED-FROM] [,SENT-BY] [,CN] [,DIR] [,LANGUAGE] [,xparams] ) CUTYPE = "CUTYPE" => "INDIVIDUAL" (An individual, Default) / "GROUP" (A group of individuals) / "RESOURCE" (A physical resource) / "ROOM" (A room resource) / "UNKNOWN" (Otherwise not known) / x-name (Experimental type) / iana-token (Other IANA registered type) MEMBER = "MEMBER" => array( *[ "single member of the group or list membership"]) ROLE = "ROLE" => "CHAIR" (Indicates chair of the calendar entity) / "REQ-PARTICIPANT" (required participation, Default) / "OPT-PARTICIPANT" (optional participation) / "NON-PARTICIPANT" (information purposes only) / x-name (Experimental role) / iana-token (Other IANA role) PARTSTAT = "PARTSTAT" => "NEEDS-ACTION" (Event needs action, Default) / "ACCEPTED" (Event accepted) / "DECLINED" (Event declined) / "TENTATIVE" (Event tentatively accepted) / "DELEGATED" (Event delegated) / "NEEDS-ACTION" (To-do needs action, Default) / "ACCEPTED" (To-do accepted) / "DECLINED" (To-do declined) / "TENTATIVE" (To-do tentatively accepted) / "DELEGATED" (To-do delegated) / "COMPLETED" (To-do completed. COMPLETED property has date/time completed) / "IN-PROCESS" (To-do in process of being completed) / "NEEDS-ACTION" (Journal needs action, Default) / "ACCEPTED" (Journal accepted) / "DECLINED" (Journal declined) / x-name (Experimental status) / iana-token (Other IANA registered status) RSVP = "RSVP" => "TRUE" / "FALSE", Default (reply expectation) DELEGATED-TO = "DELEGATED-TO" => array(*["single calendar user to whom the calendar user specified by the property has delegated participation"]) DELEGATED-FROM = "DELEGATED-FROM" => array( *[ "single calendar user that have delegated their participation to the calendar user specified by the property" ] ) SENT-BY = "SENT-BY" => single calendar user that is acting on behalf of the calendar user specified by the property" LANGUAGE = "LANGUAGE" => language for text values in CN parameter" CN = "CN" => "common name to be associated with the calendar user specified by the property" DIR = "DIR" => "reference to a directory entry associated with the calendar user specified by the property" xparam = *[ xparamkey => xparamvalue ] propOrderNo = int ordernumber, 1=1st, 2=2nd etc
See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.Example
$vevent->setProperty( "attendee" , "attendee1@ical.net" $vevent->setProperty( "attendee" , "attendee2@ical.net" , array( "cutype" => "INDIVIDUAL" , "member" => array( "member1@ical.net" , "member2@ical.net" , "member3@ical.net" ) , "role" => "CHAIR" , "PARTSTAT" => "ACCEPTED" , "RSVP" => "TRUE" , "DELEgated-to" => array( "part1@ical.net" , "part2@ical.net" , "part3@ical.net" ) , "delegateD-FROM" =>array( "cio@ical.net" , "vice.cio@ical.net") , "SENT-BY" => "secretary@ical.net" , "LANGUAGE" => "us-EN" , "CN" => "John Doe" , "DIR" => "http://www.ical.net/info.doc" , "x-agenda" => "status reports" // xparam , "x-length" => "15 min" )); // xparam
Format
deleteProperty( "CATEGORIES" )
Example 1
$vevent->deleteProperty( "CATEGORIES" );
Example 2
Delete CATEGORIES property no 2.$vevent->deleteProperty( "CATEGORIES", 2 );
Example 3
Deleting all CATEGORIES properties.while( $vevent->deleteProperty( "CATEGORIES" )) continue;
Format 1
getProperty( "CATEGORIES" )
output = categoryValue1
Format 2
getProperty( "CATEGORIES", propOrderNo/FALSE , TRUE )
output = array( "value" => categories1 , "params" => params2 )
Format 3
getProperty( "CATEGORIES", propOrderNo )
Get propOrderNo CATEGORIES
Example
$categories = $valarm->getProperty( "categories" );
Format
setProperty( "categories", mixed categories [, params [, propOrderNo ]] )
categories1 = string categoryValue / array( *categoryValue ) categoryValue = textual categories or subtypes of the calendar component, can be specified as a list of categories separated by the COMMA character params2 = array( ["LANGUAGE" => "<lang>"][, xparam] ) xparam = *[ xparamkey => xparamvalue ] propOrderNo = int ordernumber, 1=1st, 2=2nd etc
Example
$vevent->setProperty( "categories", "project_x" );
Format
deleteProperty( "CLASS" )
Example
$vjournal->deleteProperty( "CLASS" );
Format 1
getProperty( "CLASS" )
output = classValue1
Format 2
getProperty( "CLASS", FALSE , TRUE )
output = array "value" => classValue1 , "params" => xparam2 )
Example
$class = $valarm->getProperty( "class" );
Format
setProperty( "class", string classvalue [, xparam ] )
classvalue1 = "PUBLIC" / "PRIVATE" / "CONFIDENTIAL" / iana-token / x-name xparam2 = array( *[ xparamkey => xparamvalue ] )
Example
$vevent->setProperty( "class", "CONFIDENTIAL" );
Format
deleteProperty( "COMMENT" )
Example 1
$vevent->deleteProperty( "COMMENT" );
Example 2
Delete COMMENT property no 2.$vevent->deleteProperty( "COMMENT", 2 );
Example 3
Deleting all COMMENT properties.while( $vevent->deleteProperty( "COMMENT" )) continue;
Format 1
getProperty( "COMMENT" )
output = commentValue1
Format 2
getProperty( "COMMENT", propOrderNo/FALSE , TRUE )
output = array( "value" => commentValue1 , "params" => params2 )
Format 3
getProperty( "COMMENT", propOrderNo )
Get propOrderNo COMMENT
Example
$comment = $vevent->getProperty( "comment" );
Format
setProperty( "comment", commentValue [, params [, propOrderNo ]] )
commentValue1 = Value type Text params2 = array( ["LANGUAGE" => "<lang>"] [, "ALTREP" => "<an alternate text representation, URI>"] [, xparam] ) xparam = *[ xparamkey => xparamvalue ] propOrderNo = int ordernumber, 1=1st, 2=2nd etc
Example
$vevent->setProperty( "comment", "this is a comment" );
Format
deleteProperty( "COMPLETED" )
Example
$vtodo->deleteProperty( "COMPLETED" );
Format 1
getProperty( "COMPLETED" )
output = completedDate1
Format 2
getProperty( "COMPLETED", FALSE , TRUE )
output = array( "value" => completedDate1 , "params" => xparam2 )
Example
$completed = $vtodo->getProperty( "completed" );
Format
setProperty( "completed", completedDate [, xparam ] )
completedDate1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec , "tz" => offset ]] ) completedDate = int year , int month , int day [, int hour , int min , int sec ] completedDate = array( int year , int month , int day [, int hour , int min , int sec [, offset ]] ) completedDate = array ( "timestamp" => int timestamp [, "tz" => offset]) completedDate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME xparam2 = array( *[ xparamkey => xparamvalue ] )
Example 1
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vtodo = new vtodo(); .. . $vtodo->setProperty( "completed", 2006, 8, 10, 10, 0, 0 ); // 10 august 2006 10.00 UTC
Example 2
$date = array("year" => 2006, "month" => 10, "day" => 10, "hour" => 10, "min" => 0, "sec" => 0, "tz" => "+0200"); // local date + UTC offset => UTC DATE-TIME $vtodo->setProperty( "completed", $date );
Format
deleteProperty( "CONTACT" )
Example 1
$vevent->deleteProperty( "CONTACT" );
Example 2
Delete CONTACT property no 2.$vevent->deleteProperty( "CONTACT", 2 );
Example 3
Deleting all CONTACT properties.while( $vevent->deleteProperty( "CONTACT" )) continue;
Format 1
getProperty( "CONTACT" )
output = contactValue1
Format 2
getProperty( "CONTACT", propOrderNo/FALSE , TRUE )
output = array( "value" => contactValue1 , "params" => params2 )
Format 3
getProperty( "CONTACT", propOrderNo )
Get propOrderNo CONTACT
Example
$contact = $vevent->getProperty( "contact" );
Format
setproperty( "contact", contactValue [, params [, propOrderNo ]] )
contactValue1 = Value type TEXT params2 = array ( ["LANGUAGE" => "<lang>"] [, "ALTREP" => "<an alternate text representation, URI>"] [, xparam] ) xparam = *[ xparamkey => xparamvalue ] propOrderNo = int ordernumber, 1=1st, 2=2nd etc
Example
$c->setProperty( "contact", "tel 012-34 56 789" )
Format
deleteProperty( "CREATED" )
Example
$vevent->deleteProperty( "CREATED" );
Format 1
getProperty( "CREATED" )
output = createdDate1
Format 2
getProperty( "CREATED", FALSE , TRUE )
output = array( "value" => createdDate1 , "params" => xparam2 )
Example
$created = $vevent->getProperty( "CREATED" );
Format
setProperty( "created", [ createdDate [, xparam ]] )
createdDate1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec , "tz" => offset ]] ) createdDate = int year , int month , int day [, int hour , int min , int sec ] createdDate = array( int year , int month , int day [, int hour , int min , int sec [, offset ]] ) createdDate = array ( "timestamp" => int timestamp [, "tz" => offset ]) createdDate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME xparam2 = array( *[ xparamkey => xparamvalue ] )
Example 1
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vtodo = new vtodo(); .. . $vevent->setProperty( "created", 2006, 8, 11, 14, 30, 35 ); // 11 august 2006 14.30.35 UTC
Example 2
$date = array("year" => 2006, "month" => 10, "day" => 10, "hour" => 10, "min" => 0, "sec" => 0, "tz" => "+0200"); // local date + UTC offset => UTC DATE-TIME $vtodo->setProperty( "created", $date ); .. .
Example 3
$vevent->setProperty( "created" ); // current UTC date-time is set if called without parameters
Format
deleteProperty( "DESCRIPTION" )
Example 1
$vevent->deleteProperty( "DESCRIPTION" );
Example 2
Delete DESCRIPTION property no 2.$vjournal->deleteProperty( "DESCRIPTION", 2 );
Example 3
Deleting all DESCRIPTION properties.while( $vjournal->deleteProperty( "DESCRIPTION" )) continue;
Format 1
getProperty( "DESCRIPTION" )
output = descriptionValue1
Format 2
getProperty( "DESCRIPTION", FALSE , TRUE )
output = array( "value" => descriptionValue1 , "params" => params2 )
Example
$description = $vevent->getProperty( "description" );
Format
setProperty( "description", descriptionValue [, params [, propOrderNo ]] )
descriptionValue1 = Value type TEXT params2 = array( ["LANGUAGE" => "<lang>"] [, "ALTREP" => "<an alternate text representation, URI>"] [, xparam] ) xparam = *[ xparamkey => xparamvalue ] propOrderNo = int ordernumber, 1=1st, 2=2nd etc
Example
$vevent->setProperty( "description", "This is a description" );
Format
deleteProperty( "DTEND" )
Example
$vevent->deleteProperty( "DTEND" );
Format 1
getProperty( "DTEND" )
output = dtendDate1
Format 2
getProperty( "DTEND", FALSE , TRUE )
output = array( "value" => dtendDate1 , "params" => params2 )
Example
$dtend = $vevent->getProperty( "dtend" );
Format
setProperty( "dtend", dtendDate [, params2 ] )
dtendDate1 = array ( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec [, "tz" => mixed tz ]] ) dtendDate = int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] dtendDate = array( int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] ) dtendDate = array( "timestamp" => int timestamp [,"tz" => mixed tz]) dtendDate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) dtendDate : Within the "VFREEBUSY" calendar component, the time MUST be specified in the UTC time format. tz = timezone / UTC offset offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME params2 = array([ tzidparam/datetimeparam/dateparam ] *[,xparams]) tzidparam = timezone identifier // date output as local date-time with timezone identifier datetimeparam = "VALUE" => "DATE-TIME" // default, date output as date-time dateparam = "VALUE" => "DATE" // date output as DATE, ex. all-day event xparams = xparamkey => xparamvalue
Example 1
$vevent->setProperty( "dtend" , 2006, 8, 11, 16, 30, 0 ); // 11 august 2006 16.30.00 local date
Example 2
$vfreebusy->setProperty( "dtend" , 2006, 8, 11, 16, 30, 0, "-040000" ); // 11 august 2006 16.30.00 -040000 : local date + UTC offset => UTC DATE-TIME
Example 3
$vevent->setProperty( "dtend" , array( 'year' =>, 2006, 'month' => 8, 'day'=> 11 ) , array( 'VALUE' => 'DATE' )); // end of one or more all-day events
Format
deleteProperty( "DTSTAMP" )
Example
$vevent->deleteProperty( "DTSTAMP" );
Format 1
getProperty( "DTSTAMP" )
output = dtstampDate1
Format 2
getProperty( "DTSTAMP", FALSE , TRUE )
output = array( "value" => dtstampDate1 , "params" => xparam2 )
Example
$dtstamp = $vevent->getProperty( "dtstamp" );
Format
setProperty( "dtstamp", dtstampDate [, xparam ] )
dtstampDate1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec , "tz" => offset ]] ) dtstampDate = int year , int month , int day [, int hour , int min , int sec ] dtstampDate = array( int year , int month , int day [, int hour , int min , int sec [, offset ]] ) dtstampDate = array ( "timestamp" => int timestamp [, "tz" => offset ]) dtstampDate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME xparam2 = array( *[ xparamkey => xparamvalue ] )
Example 1
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vtodo = new vtodo(); .. . $vevent->setProperty( "dstamp" , 2006, 8, 11, 7, 30, 1 ); // 11 august 2006 07.30.01 UTC
Example 2
$date = array("year" => 2006, "month" => 10, "day" => 10, "hour" => 10, "min" => 0, "sec" => 0, "tz" => "+0200"); // local date + UTC offset => UTC DATE-TIME $vtodo->setProperty( "dtstamp", $date ); .. .
Format
deleteProperty( "DTSTART" )
Example
$vevent->deleteProperty( "DTSTART" );
Format 1
getProperty( "DTSTART" )
output = dtstartDate1
Format 2
getProperty( "DTSTART", FALSE , TRUE )
output = array( "value" => dtstartDate1 , "params" => params2 )
Example
$dtstart = $vevent->getProperty( "dtstart" );
Format
setProperty( "dtstart", dtstartDate [, params ] )
dtstartDate1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec [, "tz" => mixed tz ]] ) dtstartDate = int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] dtstartDate = array( int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] ) dtstartDate = array("timestamp" => int timestamp [, "tz" => mixed tz]) dtstartDate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) dtstartDate : Within the "VFREEBUSY" calendar component, the dtstartDate MUST be specified in the UTC time format. tz = timezone / offset offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME params2 = array([ tzidparam/datetimeparam/dateparam ] *[, xparams]) tzidparam = timezone identifier // date output as local date-time with timezone identifier datetimeparam = "VALUE" => "DATE-TIME" // default, date output as date-time dateparam = "VALUE" => "DATE" // date output as DATE, ex. all-day event xparams = xparamkey => xparamvalue
Example 1
$vevent->setProperty( "dstart" , 2006, 8, 11, 7, 30, 1 ); // 11 august 2006 07.30.01 local date
Example 2
$vevent->setProperty( "dstart" , 2006, 8, 11, 16, 30, 0, "-040000" ); // 11 august 2006 16.30.00 -040000, // local date + UTC offset => UTC DATE-TIME
Example 3
$vevent->setProperty( "dtstart" , array( 'year' =>, 2006, 'month' => 8, 'day'=> 11 ) , array( 'VALUE' => 'DATE' )); // start of an all-day event, or a period of (entire) days
Format
deleteProperty( "DUE" )
Example
$vtodo->deleteProperty( "DUE" );
Format 1
getProperty( "DUE" )
output = dueDate1
Format 2
getProperty( "DUE", FALSE , TRUE )
output = array( "value" => dueDate1 , "params" => params2 )
Example
$due = $vtodo->getProperty( "due" );
Format
setProperty( "due", dueDate [, params ] )
dueDate1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec [, "tz" => mixed tz ]] ) dueDate = int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] dueDate = array( int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] ) dueDate = array( "timestamp" => int timestamp [, "tz" => mixed tz]) dueDate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) tz = timezone / offset offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME params2 = array([ tzidparam/datetimeparam/dateparam ] *[, xparams]) tzidparam = timezone identifier // date output as local date-time with timezone identifier datetimeparam = "VALUE" => "DATE-TIME" // default, date output as date-time dateparam = "VALUE" => "DATE" // date output as DATE, "during the day" xparams = xparamkey => xparamvalue
Example 1
$vtodo->setProperty( "due" , 2006, 8, 11, 18, 0, 0 ); // 11 august 2005 18.00.00 local date
Example 2
$vtodo->setProperty( "due" , 2006, 8, 11, 16, 30, 0, "-040000" ); // 11 august 2006 16.30.00 -040000 // local date + UTC offset sets UTC DATE-TIME
Example 3
$vevent->setProperty( "due" , array( 'year' =>, 2006, 'month' => 8, 'day'=> 11 ) , array( 'VALUE' => 'DATE' )); // due "during the day"
Format
deleteProperty( "DURATION" )
Example
$valarm->deleteProperty( "DURATION" );
Format 1
getProperty( "DURATION" )
output = duration1
Format 2
getProperty( "DURATION", FALSE , TRUE )
output = array( "value" => duration1 , "params" => xparam2 )
Example
$duration = $vtodo->getProperty( "duration" );
option
If a 4th argument is used and set to TRUE, returned output is in a DATE-TIME output format (like DTEND / DUE), based on DTSTART value with added DURATION value.Format
setProperty( "duration", duration [, xparam ] )
duration1 = array ( "week" => int week ) duration1 = array ( "day" => int day ) [, "hour" => int hour , "min" => int min , "sec" => int sec ]) duration = array ( "sec" => int sec ) duration = array( int week/false [, int day/false [, int hour , int min , int sec ]] ) duration = int week/false [, int day/false [, int hour , int min , int sec ]] duration = string dur-value = ["+"] "P" (dur-date/dur-time/dur-week) dur-date = dur-day [dur-time] dur-time = "T" (dur-hour / dur-minute / dur-second) dur-week = 1*DIGIT "W" dur-hour = 1*DIGIT "H" [dur-minute] dur-minute = 1*DIGIT "M" [dur-second] dur-second = 1*DIGIT "S" dur-day = 1*DIGIT "D" xparam2 = array( *[ xparamkey => xparamvalue ] )
Example 1
$vtodo->setProperty "duration" , array( "day" => 1 ));
// one day
Example 2
$vtodo->setProperty( "duration" , "PT4H" );
// four hours
Format
deleteProperty( "EXDATE" )
Example 1
$vtodo->deleteProperty( "EXDATE" );
Example 2
Delete EXDATE property no 2.$vjournal->deleteProperty( "EXDATE", 2 );
Example 3
Deleting all EXDATE properties.while( $vjournal->deleteProperty( "EXDATE" )) continue;
Format 1
getProperty( "EXDATE" )
output = exdates1
Format 2
getProperty( "exdate", propOrderNo/FALSE, TRUE )
output = array( "value" => exdates1 , "params" => xparams2 )
Format 3
getProperty( "EXDATE", propOrderNo )
Get propOrderNo EXDATE
Example
$exdate = $vtodo->getProperty( "exdate" );
Format
setProperty( "exdate", exdates [, xparams [, propOrderNo ]] )
exdates1 = array ( date *[, date ] ) date = array( int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] ) date1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec [, "tz" => mixed tz ]] ) date = array( "timestamp" => int timestamp [, "tz" => mixed tz]) date = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) tz = timezone / offset offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME params2 = array([(datetimeparam/dateparam) / tzidparam] [,xparam]) datetimeparam = "VALUE" => "DATE-TIME" // default, date output as date-time dateparam = "VALUE" => "DATE" // date output as DATE tzidparam = "TZID" => text xparams = *[ xparamkey => xparamvalue ] propOrderNo = int ordernumber, 1=1st, 2=2nd etc
Example 1
$vevent->setProperty( "exdate" , array( array( 2006, 8, 14, 16, 0, 0 )); // >exclude 2006-08-14 16.00.00 (local date) from recurrence pattern
Example 2
$vevent->setProperty( "exdate" , array( array('year' =>,2006,'month' => 8,'day'=> 11)) , array( 'VALUE' => 'DATE' )); // exclude 2006-08-11 from recurrence pattern;
Format
deleteProperty( "EXRULE" )
Example 1
$vtodo->deleteProperty( "EXRULE" );
Example 2
Delete EXRULE property no 2.$vjournal->deleteProperty( "EXRULE", 2 );
Example 3
Deleting all EXRULE properties.while( $vjournal->deleteProperty( "EXRULE" )) continue;
Format 1
getProperty( "EXRULE" )
output = recur1
Format 2
getProperty( "exrule", propOrderNo/FALSE, TRUE )
output = array( "value" => recur1 , "params" => xparam2 )
Format 3
getProperty( "EXRULE", propOrderNo )
Get propOrderNo EXRULE
Example
$exrule = $vtodo->getProperty( "exrule" );
Format
setProperty( "exrule", recur [, xparams [, propOrderNo ]] )
See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.recur1 = array( "FREQ"=>freq // either UNTIL or COUNT may appear in a "recur", but UNTIL and COUNT MUST NOT occur in the same "recur" [, "UNTIL" "=>" >enddate ] [, "COUNT" "=>" 1*DIGIT ] // the rest of these keywords are optional, but MUST NOT occur more than once [, "INTERVAL" "=>" 1*DIGIT ] [, "BYSECOND" "=>" byseclist ] [, "BYMINUTE" "=>" byminlist ] [, "BYHOUR" "=>" byhrlist ] [, "BYDAY" "=>" bywdaylist ] [, "BYMONTHDAY" "=>" bymodaylist ] [, "BYYEARDAY" "=>" byyrdaylist ] [, "BYWEEKNO" "=>" bywknolist ] [, "BYMONTH" "=>" bymolist ] [, "BYSETPOS" "=>" bysplist ] [, "WKST" "=>" weekday ] [, x-name "=>" text ] ) freq = "SECONDLY" / "MINUTELY" / "HOURLY" / "DAILY" / "WEEKLY" / "MONTHLY" / "YEARLY" enddate = date enddate = / date-time ;An UTC DATE-TIME value byseclist = seconds byseclist = array(seconds *(, seconds )) seconds = 1DIGIT / 2DIGIT ;0 to 59 byminlist = minutes byminlist = array( minutes *(, minutes )) minutes = 1DIGIT / 2DIGIT ;0 to 59 byhrlist = hour byhrlist = array( hour *(, hour )) hour = 1DIGIT / 2DIGIT ;0 to 23 bywdaylist = weekdaynum bywdaylist = array( weekdaynum *("," weekdaynum )) weekdaynum = array( [([plus] ordwk / minus ordwk)], "DAY" => weekday ) plus = "+" minus = "-" ordwk = 1DIGIT / 2DIGIT ;1 to 53 weekday = "SU" / "MO" / "TU" / "WE" / "TH" / "FR" / "SA" ; Corresponding to ; SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, ; FRIDAY, SATURDAY and SUNDAY days of the week. bymodaylist = monthdaynum bymodaylist = array( monthdaynum *(, monthdaynum )) monthdaynum = ( [plus] ordmoday ) / ( minus ordmoday ) ordmoday = 1DIGIT / 2DIGIT ;1 to 31 byyrdaylist = yeardaynum byyrdaylist = array( yeardaynum *(, yeardaynum )) yeardaynum = ( [plus] ordyrday ) / ( minus ordyrday ) ordyrday = 1DIGIT / 2DIGIT / 3DIGIT ;1 to 366 bywknolist = weeknum bywknolist = array( weeknum *(, weeknum )) weeknum = ( [plus] ordwk ) / ( minus ordwk ) bymolist = monthnum bymolist = array( monthnum *(, monthnum )) monthnum = 1DIGIT / 2DIGIT ;1 to 12 bysplist = setposday bysplist = array( setposday *(, setposday )) setposday = yeardaynum
xparam2 = array( *[ xparamkey => xparamvalue ] ) propOrderNo = int ordernumber, 1=1st, 2=2nd etc
Example
$vevent->setProperty( "Exrule" , array( "FREQ" => "MONTHLY" , "UNTIL" => "20060831" // DATE / DATE-TIME in UTC format; string/array, see CREATED format , "INTERVAL" => 2 , "WKST" => "SU" , "BYSECOND" => 2 , "BYMINUTE" => array( 2, -4, 6 ) // (*) , "BYHOUR" => array( 2, 4, -6 ) // (*) , "BYMONTHDAY" => -2 // (*) , "BYYEARDAY" => 2 // (*) , "BYWEEKNO" => array( 2, -4, 6 ) // (*) , "BYMONTH" => 2 // (*) , "BYSETPOS" => array( 2, -4, 6 ) // (*) , "BYday" => array( array(-2, "DAY" => "WE" ) , array( 3, "DAY" => "TH") , array( 5, "DAY" => "FR") , array( "DAY" => "MO")) // (**) , "X-NAME" => "x-value" ) , array( "xparamkey" => "xparamValue" )); $vtodo->setProperty( >"exrule" , array( "FREQ" => "WEEKLY" , "COUNT" => 2 , "INTERVAL" => 2 , "WKST" => "SU" , "BYSECOND" => array( -2, 4, 6 ) // (*) , "BYMINUTE" => -2 // (*) , "BYHOUR" => 2 // (*) , "BYMONTHDAY" => array( 2, -4, 6 ) // (*) , "BYYEARDAY" => array( -2, 4, 6 ) // (*) , "BYWEEKNO" => -2 // (*) , "BYMONTH" => array( 2, 4, -6 ) // (*) , "BYSETPOS" => -2 // (*) , "BYday" => array( 5, "DAY" => "WE" ) // (**) , "X-NAME" => "x-value" ) , array( "xparamkey" => "xparamValue" )); //(*) single value/array of values //(**) single value array /array of arrays
Format
deleteProperty( "FREEBUSY" )
Example 1
$vfreebusy->deleteProperty( "FREEBUSY" );
Example 2
Delete FREEBUSY property no 2.$vfreebusy->deleteProperty( "FREEBUSY", 2 );
Example 3
Deleting all FREEBUSY properties.while( $vfreebusy->deleteProperty( "FREEBUSY" )) continue;
Format 1
getProperty( "FREEBUSY" )
output = array( "fbtyp" => freebusytype1 , periods2 )
Format 3
getProperty( "FREEBUSY", propOrderNo/FALSE , TRUE )
output = array( "value" => array("fbtype" => freebusytype1 ,periods2) , "params" => xparams 3 )
Format 3
getProperty( "FREEBUSY", propOrderNo )
Get propOrderNo FREEBUSY
Example
$freebusy = $vfreebusy->getProperty( "FREEBUSY" );
Format
setProperty( "freebusy", freebusytype, fbperiods [, xparams [, propOrderNo ]] )
freebusytype1 = one of "FREE" / "BUSY" Default / "BUSY-UNAVAILABLE" / "BUSY-TENTATIVE" / x-name fbperiods = array( periods2 ) periods2 = array( startdate, enddate/duration ) *[, array( startdate, enddate/duration )] startdate/enddate = array( int year , int month , int day , int int hour , int min , int day ) startdate/enddate = array( "year" => int year , "month" => int month , "day" => int day , "hour" => int hour , "min" => int min , "sec" => int sec ) // output format startdate/enddate = array( "timestamp" => int timestamp ) startdate/enddate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) startdate/enddate : date and time values MUST be an UTC DATE-TIME duration = array( int week/false [, int day/false , int hour , int min , int sec] ) duration = array( "week" => int week/false [, "day" => int day/false [, "hour" => int hour , "min" => int min , "sec" => int sec ]] ); // output format duration = array( "sec" => int sec ) duration = string dur-value = (["+"]/"-") "P" (dur-date/dur-time/dur-week) dur-date = dur-day [dur-time] dur-time = "T" (dur-hour / dur-minute / dur-second) dur-week = 1*DIGIT "W" dur-hour = 1*DIGIT "H" [dur-minute] dur-minute = 1*DIGIT "M" [dur-second] dur-second = 1*DIGIT "S" dur-day = 1*DIGIT "D" xparams3 = array( *[ xparamkey => xparamvalue ] ) propOrderNo = int ordernumber, 1=1st, 2=2nd etc
Example
See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.$fdate1 = array ( 2001, 1, 1, 1, 1, 1 ); alt. $fdate1 = array ( "year" => 2001 , "month" => 1 , "day" => 1 , "hour" => 1 , "min" => 1 , "sec" => 1 ); $fdate2 = array ( 2002, 2, 2, 2, 2, 2 ); $fdate3 = array ( 2003, 3, 3, 3, 3, 3 ); $fdate4 = "4 April 2005 4:4:4"; $fdate7 = array ( "year" => 2007 , "month" => 7 , "day" => 7 ); $fdur6 = array ( "week" => 0 , "day" => 5 , "hour" => 5 , "min" => 5 , "sec" => 5 ); $fdur7 = array ( 0, 0, 6 ); // duration for 6 hours $fdur8 = "P2D"; // duration two days $freebusy->setProperty "freebusy" , "FREE" , array( array( $fdate1, $fdate2 ) , array( $fdate3, $fdur6 ) , array( $fdate4, $fdate5 ))); $freebusy->setProperty("freebusy" , "Busy" , array( array( array( $fdate1, $fdate2 ) , array( $fdate3, $fdur8 ) , array( $fdate4, $fdur7 ) , array( $fdate1, $fdate3 )));
Format
deleteProperty( "GEO" )
Example
$vevent->deleteProperty( "FREEBUSY" );
Format 1
getProperty( "GEO" )
output = array( "latitude" => <latitude> , "longitude" => <longitude>))
Format 2
getProperty( "GEO", FALSE , TRUE )
output = array( "value" => array ( "latitude" => <latitude> , "longitude" => <longitude>)) , "params" => xparam 1 )
Example
$geo = $vevent->getProperty( "GEO" );
Format
setProperty( "geo", float latitude, float longitude [, xparam ] )
xparam 1 = array( *[ xparamkey => xparamvalue ] )
Example
$vevent->setProperty( "geo", 11.23456, -23.45678 );
Format
deleteProperty( "LAST-MODIFIED" )
Example
$vevent->deleteProperty( "LAST-MODIFIED" );
Format 1
getProperty( "LAST-MODIFIED" )
output = moddate1
Format 2
getProperty( "LAST-MODIFIED", FALSE , TRUE )
output = array( "value" => moddate1 , "params" => xparam2 )
Example
$last-mod = $vevent->getProperty( "LAST-MODIFIED" );
Format
setProperty( "Last-Modified" [, moddate [, xparam ]] )
moddate1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec , "tz" => offset ]] ) completedDate = int year , int month , int day [, int hour , int min , int sec ] completedDate = array( int year , int month , int day [, int hour , int min , int sec [, offset ]] ) completedDate = array ( "timestamp" => int timestamp [, "tz" => offset ]) completedDate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME xparam2 = array( *[ xparamkey => xparamvalue ] )
Example 1
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vtodo = new vtodo(); .. . $vevent->setProperty("last-modified" ,
Example 2
$date = array("year" => 2006, "month" => 10, "day" => 10, "hour" => 10, "min" => 0, "sec" => 0, "tz" => "+0200"); // local date + UTC offset => UTC DATE-TIME $vtodo->setProperty( "last-modified", $date ); .. .
Example 3
$vevent->setProperty( "last-modified" ); // current UTC DATE-TIME is set if called without parameters
Format
deleteProperty( "LOCATION" )
Example
$vevent->deleteProperty( "LOCATION" );
Format 1
getProperty( "LOCATION" )
output = location1
Format 2
getProperty( "LOCATION", FALSE , TRUE )
output = array( "value" => location1 , "params" => param2 )
Example
$location = $vevent->getProperty( "LOCATION" );
Format
setProperty( "location", string location [, array param] )
location1 = Value type TEXT params2 = array( ["LANGUAGE" => "<lang>"] [, "ALTREP" => "<an alternate text representation, URI>"] [, xparam ] xparam = *[ xparamkey => xparamvalue ]
Example
$vevent->setProperty( "location", "Buckingham Palace" );
Format
deleteProperty( "ORGANIZER" )
Example
$vevent->deleteProperty( "ORGANIZER" );
Format 1
getProperty( "ORGANIZER" )
output = organizer1
Format 2
getProperty( "ORGANIZER", FALSE , TRUE )
output = array( "value" => organizer1 , "params" => params2 )
Example
$organizer = $vevent->getProperty( "ORGANIZER" );
Format
setProperty( "organizer", organizer [, params] )
organizer1 = a calendar user address, a URI as defined by [RFC 1738] or any other IANA registered form for a URI. params2 = array( ["LANGUAGE" => "<lang>" (applies to the CN parameter value) ] [, "CN" => "common name to be associated with the calendar user specified by the property"] [, "DIR" => "reference to a directory entry associated with the calendar user specified by the property" ] [, "SENT-BY" => "single calendar user that is acting on behalf of the calendar user specified by the property" ] [, xparam ] xparam = *[ xparamkey => xparamvalue ]
Example
$dir = "ldap://host.com:6666/o=3DDC%20Comp,c=3DUS??(cn=3DJohn%20Doe)"; $vevent->setProperty( "organizer" , "ical@domain.com" , array( "CN" => "John Doe" , "DIR" => $dir , "SENT-BY" => "secretary@domain.com" , "x-Key1" => "x-Value" , "x-Key2" => "y-Value" ));
Format
deleteProperty( "PERCENT-COMPLETE" )
Example
$vtodo->deleteProperty( "PERCENT-COMPLETE" );
Format 1
getProperty( "PERCENT-COMPLETE" )
output = percent1
Format 2
getProperty( "PRIORITY", FALSE , TRUE )
output = array( "value" => percent1 , "params" => xparam2 )
Example
$percent = $vtodo->getProperty( "PERCENT-COMPLETE" );
Format
setProperty( "Percent-Complete", percent [, xparam ] )
percent1 = Value type INTEGER xparam2 = array( *[ xparamkey => xparamvalue ] )
Example
$vtodo->setProperty( "percent-complete", 90 );
Format
deleteProperty( "PRIORITY" )
Example
$vevent->deleteProperty( "PRIORITY" );
Format 1
getProperty( "PRIORITY" )
output = priority1
Format 2
getProperty( "PRIORITY", FALSE , TRUE )
output = array( "value" => priority1 , "params" => xparam2 )
Example
$priority = $vevent->getProperty( "priority" );
Format
setProperty( "priority", priority [, xparam ] )
priority1 = Value type INTEGER xparam2 = array( *[ xparamkey => xparamvalue ] )
Example
$vevent->setProperty( "priority", 3 );
Format
deleteProperty( "RDATE" )
Example 1
$vtodo->deleteProperty( "RDATE" );
Example 2
Delete RDATE property no 2.$vjournal->deleteProperty( "RDATE", 2 );
Example 3
Deleting all RDATE properties.while( $vjournal->deleteProperty( "RDATE" )) continue;
Format 1
getProperty( "RDATE" )
output = dates1
Format 2
getProperty( "RDATE", propOrderNo/FALSE , TRUE )
output = array( "value" => dates1 , "params" => params2 )
Format 3
getProperty( "RDATE", propOrderNo )
Get propOrderNo RDATE
Example
$rdates = $vevent->getProperty( "RDATE" );
Format
setProperty( "rdate", dates [, params [, propOrderNo ]] )
dates1 = array ( date2 *[, date2 ] ) date2 = date date2 = array( startdate, enddate/duration ) ] startdate = date enddate = date date = array( int year , int month , int day [, int int hour , int min , int day , mixed tz ] ) date = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec [, "tz" => mixed tz ]] ) // output format date = array( "timestamp" => int timestamp [, "tz" => mixed tz ] ) date = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) tz = timezone / offset offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME duration = array( int week/false [, int day/false , int hour , int min , int sec] ) duration = array([ "week" => int week/false ,] / [ "day" => int day/false [, "hour" => int hour , "min" => int min , "sec" => int sec ]] ); // output format, only used keys duration = array( "sec" => int sec ); duration = string format duration like "P15DT5H0M20S" params2 = ([tzidparam ( / datetimeparam / dateparam / periodparam )] *[, xparams ] ) tzidparam = timezone identifier // date output as local DATE-TIME with timezone identifier datetimeparam = "VALUE" => "DATE-TIME" // default, date output as DATE-TIME dateparam = "VALUE" => "DATE" // date output as DATE periodparam = "VALUE" => "PERIOD" // date output as PERIOD (datetime) xparams = xparamkey => xparamvalue propOrderNo = int ordernumber, 1=1st, 2=2nd etc
Example
See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.// $rdate1 = array ( 2001, 1, 1, 1, 1, 1 ); // alt. $rdate1 = array( "year" => 2001 , "month" => 1 , "day" => 1 , "hour" => 1 , "min" => 1 , "sec" => 1 , "tz" => "GMT" ); $rdate2 = array( 2002, 2, 2, 2, 2, 2, "GMT" ); $rdate3 = "3 March 2003 03.03.03"; $rdate4 = array( 2004, 4, 4, 4, 4, 4, "GMT" ); $rdate5 = array( 2005, 10, 5, 5, 5, 5 ); $rdate8 = array( "year" => 2007, "month" => 7, "day" => 7 ); $rdur6 = array( "week" => 0 , "day" => 0 , "hour" => 5 , "min" => 5 , "sec" => 5 ); $rdur7 = array( 0, 0, 6 ); // duration for 6 hours $rdur8 = array( "week" => 8 ); // duration for 8 weeks $vevent = new vevent(); $vevent->setProperty( "rdate", array( $rdate1 )); // one recurrence date, date in 7-params format (DATE-TIME) $vevent->setProperty( "rdate", array( $rdate1, $rdate2 )); // two dates, date 7-params format (DATE-TIME) $vevent->setProperty( "rdate", array( array( $rdate1, $rdate2 ) , array( $rdate3, $rdate4 )) , array( 'VALUE' => 'PERIOD' )); // Both fromdate and enddate must have 7 params (DATE-TIME) !!! $vevent->setProperty( "rdate", array( array( $rdate2, $rdur6 )) , array( 'VALUE' => 'PERIOD' )); // one duration (fromdate-duration) $vevent->setProperty( "rdate", array( array( $rdate1, $date2 ) , array( $rdate3, $rdur7 )) , array( 'VALUE' => 'PERIOD' )); // period, pairs of fromdate+enddate and fromdate-duration $vevent->setProperty( "rdate", array( $rdate5, $date8 )) , array( 'VALUE' => 'DATE' )); // dates in DATE format .. .
Format
deleteProperty( "RECURRENCE-ID" )
Example
$vevent->deleteProperty( "RECURRENCE-ID" );
Format 1
getProperty( "RECURRENCE-ID" )
output = recurrIdDate1
Format 2
getProperty( "RECURRENCE-ID", FALSE , TRUE )
output = array( "value" => recurrIdDate1 , "params" => params2 )
Example
$recurrDate = $vtodo->getProperty( "RECURRENCE-ID" );
Format
setProperty( "recurrence-id", recurrIdDate [, params ] )
recurrIdDate1 = array( "year" => int year , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec [, "tz" => mixed tz ]] ) recurrIdDate = int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] recurrIdDate = array( int year , int month , int day [, int hour , int min , int sec [, mixed tz ]] ) recurrIdDate = array( "timestamp" => int timestamp [, "tz" => mixed tz ] ) recurrIdDate = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) tz = timezone / offset offset = (+/-)HHmm[ss], local date + UTC offset => UTC DATE-TIME params2 = array( [ datetimeparam / dateparam ] [, rangeparam ] [, xparam ] ) datetimeparam = "VALUE" => "DATE-TIME" // default, date output as DATE-TIME dateparam = "VALUE" => "DATE" // date output as DATE rangeparam = "RANGE" => ( "THISANDPRIOR" / "THISANDFUTURE" ) // range parameter xparam = *[ xparamkey => xparamvalue ]
Example
$vtodo->setProperty( "recurrence-id", "3 March 2003 03.03.03" ); // 3 march 2003 03.03.03 local time
Format
deleteProperty( "RELATED-TO" )
Example 1
$vtodo->deleteProperty( "RELATED-TO" );
Example 2
Delete RELATED-TO property no 2.$vjournal->deleteProperty( "RELATED-TO", 2 );
Example 3
Deleting all RELATED-TO properties.while( $vjournal->deleteProperty( "RELATED-TO" )) continue;
Format 1
getProperty( "RELATED-TO" )
output = relid1
Format 2
getProperty( "RELATED-TO", propOrderNo/FALSE , TRUE )
output = array( "value" => relid1 , "params" => params2 )
Format 3
getProperty( "RELATED-TO", propOrderNo )
Get propOrderNo RELATED-TO
Example
$relatedId = $vtodo->getProperty( "RELATED-TO" );
Format
setProperty( "Related-To", relid [, params [, propOrderNo ]] )
relid1 = Value type TEXT. params2 = array( [ reltype ] [, xparam] ) reltype = "RELTYPE" => ("PARENT" (Default) / "CHILD" / "SIBLING" / iana-token / x-name) xparam = *[ xparamkey => xparamvalue ] propOrderNo = int ordernumber, 1=1st, 2=2nd etc
Example
$vtodo->setProperty( "related-to", "19960401-080045-4000F192713@host.com");
Format
deleteProperty( "REPEAT" )
Example
$valarm->deleteProperty( "REPEAT" );
Format 1
getProperty( "REPEAT" )
output = repeatTimes1
Format 2
getProperty( "REPEAT", FALSE , TRUE )
output = array( "value" => repeatTimes1 , "params" => xparam2 )
Example
$repeat = $vtodo->getProperty( "REPEAT" );
Format
setProperty( "repeat", repeatTimes [, xparam ] )
repeatTimes1 = Value type INTEGER xparam2 = array( *[ xparamkey => xparamvalue ] )
Example
$valarm->setProperty( "repeat", 2 );
Format
deleteProperty( "REQUEST-STATUS" )
Example 1
$vtodo->deleteProperty( "REQUEST-STATUS" );
Example 2
Delete REQUEST-STATUS property no 2.$vjournal->deleteProperty( "REQUEST-STATUS", 2 );
Example 3
Deleting all REQUEST-STATUS properties.while( $vjournal->deleteProperty( "REQUEST-STATUS" )) continue;
Format 1
getProperty( "REQUEST-STATUS" )
output = array( "statcode" => statcode1 , "text" => errtext2 [ , "extdata" => extraData 3 ] )
Format 2
getProperty( "REQUEST-STATUS", propOrderNo/FALSE, TRUE )
output = array( "value" => array( "statcode" => statcode1 , "text" => errtext2 [ , "extdata" => extraData3 ] ) , "params" => params4 )
Format 3
getProperty( "REQUEST-STATUS", propOrderNo )
Get propOrderNo REQUEST-STATUS
Example
$requestStatus = $vtodo->getProperty( "REQUEST-STATUS" );
Format
setProperty( "Request-Status" , statcode, errtext [, extraData/FALSE [, params [, propOrderNo ]]] )
statcode1 = Hierarchical, numeric return status code (1*DIGIT *("." 1*DIGIT)) errtext2 = Textual status description extraData3 = Textual exception data. For example, the offending property name and value or complete property line. params4 = array( ["LANGUAGE" => "<lang>"] [, xparam ] ) xparam = *[ xparamkey => xparamvalue ] propOrderNo = int ordernumber, 1=1st, 2=2nd etc
Example
$vfreebusy->setProperty("request-status" , 2.0 , "Invalid property value" , "DTSTART:96-Apr-31");
Format
deleteProperty( "RESOURCES" )
Example 1
$vevent->deleteProperty( "RESOURCES" );
Example 2
Delete RESOURCES property no 2.$vevent->deleteProperty( "RESOURCES", 2 );
Example 3
Deleting all RESOURCES properties.while( $vevent->deleteProperty( "RESOURCES" )) continue;
Format 1
getProperty( "RESOURCES" )
output = resources1
Format 2
getProperty( "RESOURCES", propOrderNo/FALSE, TRUE )
output = array( "value" => resources1 , "params" => params2 )
Format 3
getProperty( "RESOURCES", propOrderNo )
Get propOrderNo RESOURCES
Example
$resources = $vtodo->getProperty( "RESOURCES" );
Format
setProperty( "resources", resources [, params [, propOrderNo ]] )
resources1 = string resource / array( *resource ) resource = textual resources or subtypes of the calendar component, can be specified as a list of resources separated by the COMMA character. params2 = array([ "LANGUAGE" => "<lang>"] ) [, "ALTREP" => "<an alternate text representation, URI>"] [, xparam] xparam = *[ xparamkey => xparamvalue ] propOrderNo = int ordernumber, 1=1st, 2=2nd etc
Example
$vevent->setProperty( "resources", "COMPUTER PROJECTOR" );
Format
deleteProperty( "RRULE" )
Example 1
$vevent->deleteProperty( "RRULE" );
Example 2
Delete RRULE property no 2.$vevent->deleteProperty( "RRULE", 2 );
Example 3
Deleting all RRULE properties.while( $vevent->deleteProperty( "RRULE" )) continue;
Format 1
getProperty( "RRULE" )
output = recur1
Format 2
getProperty( "RRULE", propOrderNo/FALSE, TRUE )
output = array( "value" => recur1 , "params" => xparams2 )
Format 3
getProperty( "RRULE", propOrderNo )
Get propOrderNo RRULE
Example
$rrules = $vtodo->getProperty( "RRULE" );
Format
setProperty( "rrule", recur [, xparams [, propOrderNo ]] )
For rules example see Exrule format and in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar) in text and HTML format.
recur1 = see Exrule xparams2 = array( *[ xparamkey => xparamvalue ] ) propOrderNo = int ordernumber, 1=1st, 2=2nd etc
Format
deleteProperty( "SEQUENCE" )
Example
$vtodo->deleteProperty( "SEQUENCE" );
Format 1
getProperty( "SEQUENCE" )
output = sequence1
Format 2
getProperty( "SEQUENCE", FALSE , TRUE )
output = array( "value" => sequence1 , "params" => xparam2 )
Example
$sequence = $vtodo->getProperty( "SEQUENCE" );
Format
setProperty( "sequence" [, sequence [, xparam ]] )
sequence1 = Value type INTEGER xparam2 = array( *[ xparamkey => xparamvalue ] )
Example 1
$vevent->setProperty( "sequence", 2 ); // set sequence number to 2
Example 2
$vevent->setProperty( "sequence" ); // force sequence number to be set to 1 // or, if sequence exists, incremented by 1
Format
deleteProperty( "STATUS" )
Example
$vtodo->deleteProperty( "STATUS" );
Format 1
getProperty( "STATUS" )
output = status1
Format 2
getProperty( "STATUS", FALSE , TRUE )
output = array( "value" => status1 , "params" => xparam2 )
Example
$status = $vtodo->getProperty( "STATUS" );
Format
setProperty( "status", status [, xparam ] )
// Status values for a VEVENT status1 = "TENTATIVE" // Indicates event is tentative / "CONFIRMED" // Indicates event is definite / "CANCELLED" // Indicates event was cancelled // Status values for VTODO status1 = "NEEDS-ACTION" // Indicates to-do needs action / "COMPLETED" // Indicates to-do completed / "IN-PROCESS" // Indicates to-do in process of / "CANCELLED" // Indicates to-do was cancelled // Status values for VJOURNAL status1 = "DRAFT" // Indicates journal is draft / "FINAL" // Indicates journal is final / "CANCELLED" // Indicates journal is removed xparam2 = array( *[ xparamkey => xparamvalue ] )
Example
$vevent->setProperty( "Status", "COMPLETED" );
Format
deleteProperty( "SUMMARY" )
Example
$vevent->deleteProperty( "SUMMARY" );
Format 1
getProperty( "SUMMARY" )
output = summary1
Format 2
getProperty( "SUMMARY", FALSE , TRUE )
output = array( "value" => summary1 , "params" => params2 )
Example
$summary = $vtodo->getProperty( "SUMMARY" );
Format
setProperty( "summary", summary [, params ] )
summary1 = Value type TEXT, a short, one line summary about the activity or journal entry. params2 = array( ["LANGUAGE" => "<lang>"] [, "ALTREP" => "<an alternate text representation, URI>"] [, xparam ] ) xparam = *[ xparamkey => xparamvalue ]
Example
$vevent->setProperty( "summary", "This is a summary" );
Format
deleteProperty( "TRANSP" )
Example
$vevent->deleteProperty( "TRANSP" );
Format 1
getProperty( "TRANSP" )
output = transp1
Format 2
getProperty( "TRANSP", FALSE , TRUE )
output = array( "value" => transp1 , "params" => xparam2 )
Example
$transp = $vtodo->getProperty( "TRANSP" );
Format
setProperty( "transp", transp [, xparam ] )
transp1 = "OPAQUE" / "TRANSPARENT" xparam2 = array( *[ xparamkey => xparamvalue ] )
Example
$vevent->setProperty( "transp", "TRANSPARENT" );
Format
deleteProperty( "TRIGGER" )
Example
$valarm->deleteProperty( "TRIGGER" );
Format 1
getProperty( "TRIGGER" )
output = duration/date
Format 2
getProperty( "TRIGGER", FALSE , TRUE )
output = array( "value" => duration1/date3 ) , "params" => params4 )
Example
$trigger = $vtodo->getProperty( "TRIGGER" );
Format 1
setProperty( "trigger", duration1 [, params4 ] )
Format 2
setProperty( "trigger", duration2 [, params4 ] )
Format 3
setProperty( "trigger", date3 [, params4 ] )
Format
setProperty( "trigger", int year/FALSE , int month/FALSE , int day/FALSE [, int week/FALSE [, int hour/FALSE , int min/FALSE , int sec/FALSE [, bool relatedStart=TRUE [, bool before=TRUE [, array params4 ]]]]] )
duration1 = array( "week" => int week , "relatedStart" => bool relstart , "before" => bool before ) duration1 = array( "day" => int day , "hour" => int hour , "min" => int min , "sec" => int sec , "relatedStart" => bool relstart , "before" => bool before ) relatedStart = TRUE : related start (default), FALSE : related end before = TRUE : before relatedStart (default), FALSE : after relatedStart duration2 = string dur-value = (["+"]/"-")"P"(dur-date/dur-time/dur-week) dur-date = dur-day [dur-time] dur-time = "T" (dur-hour / dur-minute / dur-second) dur-week = 1*DIGIT "W" dur-day = 1*DIGIT "D" dur-hour = 1*DIGIT "H" [dur-minute] dur-minute = 1*DIGIT "M" [dur-second] dur-second = 1*DIGIT "S" date3 = array( "year" => int year // UTC DATE-TIME , "month" => int month , "day" => int day [, "hour" => int hour , "min" => int min , "sec" => int sec ]) date3 = array ( "timestamp" => int timestamp ) // UTC DATE-TIME date3 = string datestring // string date, acceptable by strtotime-command, ex. "14 august 2006 16.00.00" (notice date restriction) // UTC DATE-TIME params4 = array( [[ reltype [, trigRelparam ]] / datetimeparam ] [, xparams ] ) reltyp = "RELATED" => "START" (default) / "END" trigRelparam = "VALUE" => "DURATION" datetimeparam= "VALUE" => "DATE-TIME" xparam = *[ xparamkey => xparamvalue ]
Example 1
$valarm->setProperty( "trigger" , FALSE, FALSE, FALSE, FALSE, 1, 2, 3 ); $valarm->setProperty( "trigger" , array ("hour"=>1,"min"=>2,"sec"=>3 ); $valarm->setProperty( "trigger" , "PT1H2M3S" ); // duration, 1 hour 2 min 3 sec, before start
Example 2
$valarm->setProperty( "trigger" , FALSE, FALSE, FALSE, 1 , FALSE, FALSE, FALSE, FALSE, FALSE ); $valarm->setProperty( "trigger" , array ( "week" => 1 , "relatedStart" => FALSE , "before" => FALSE )); $valarm->setProperty( "trigger" , "P1W" , array( "related" => "END" )); // duration, 1 week after end
Example 3
$valarm->setProperty( "trigger" , array( "year" => 2007 , "month" => 6 , "day" => 5, , "hour" => 2 , "min" => 2 , "sec" => 3 ));
Example 4
$valarm->setProperty( "trigger" , array( "year" => 2007 , "month" => 6 , "day" => 5, , "hour" => 2 , "min" => 2 , "sec" => 3 ));
Format
deleteProperty( "TZID" )
Example
$vtimezone->deleteProperty( "TZID" );
Format 1
getProperty( "TZID" )
output = tzid1
Format 2
getProperty( "TZID", FALSE , TRUE )
output = array( "value" => tzid1 , "params" => xparam2 )
Example
$tzid = $vtimezone->getProperty( "TZID" );
Format
setProperty( "tzid", tzid [, xparam ] )
tzid1 = Value type TEXT xparam2 = array( *[ xparamkey => xparamvalue ] )
Example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $timezone = new vtimezone(); $timezone->setProperty( "tzid", "US-Eastern" ); .. .
Format
deleteProperty( "TZNAME" )
Example 1
$vtimezonestd->deleteProperty( "TZNAME" );
Example 2
Delete TZNAME property no 2.$vtimezonestd->deleteProperty( "TZNAME", 2 );
Example 3
Deleting all TZNAME properties.while( $vtimezonestd->deleteProperty( "TZNAME" )) continue;
Format 1
getProperty( "TZNAME" )
output = tzname1
Format 2
getProperty( "TZNAME", propOrderNo/FALSE, TRUE )
output = array( "value" => tzname1 , "params" => params2 )
Format 3
getProperty( "TZNAME", propOrderNo )
Get propOrderNo TZNAME
Example
$tzname = $timezonestandard->getProperty( "TZNAME" );
Format
setProperty( "tzname", tzname [, params [, propOrderNo ]] )
tzname1 = Value type TEXT params2 = array( [ "LANGUAGE" => "<lang>" ] [, xparam ] ) xparam = *[ xparamkey => xparamvalue ] propOrderNo = int ordernumber, 1=1st, 2=2nd etc
Example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $timezone = new vtimezone(); $timezone->setProperty( "Tzid", "US-Eastern" ); $timezone->setProperty( "Last-Modified", "19870101" ); $timezonestandard = new vtimezone( "standard" ); $timezonestandard->setProperty( "tzname", "EST" ); .. .
Format
deleteProperty( "TZOFFSETFROM" )
Example
$vtimezonestd->deleteProperty( "TZOFFSETFROM" );
Format 1
getProperty( "TZOFFSETFROM" )
output = tzoffsetfrom1
Format 2
getProperty( "TZOFFSETFROM", FALSE , TRUE )
output = array( "value" => tzoffsetfrom1 , "params" => xparam2 )
Example
$tzoffsetfrom = $timezonestandard->getProperty( "TZOFFSETFROM" );
Format
setProperty( "tzoffsetfrom", tzoffsetfrom [, xparam ] )
tzoffsetfrom1 = (+/-)HHmm[ss], UTC offset xparam2 = array( *[ xparamkey => xparamvalue ] )
Example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $timezone = new vtimezone(); $timezone->setProperty( "Tzid", "US-Eastern" ); $timezone->setProperty( "Last-Modified", "19870101" ); $timezonestandard = new vtimezone( "standard" ); $timezonestandard->setProperty( "tzname", "EST" ); $timezonestandard->setProperty( "tzoffsetfrom", "-0500" ); .. .
Format
deleteProperty( "TZOFFSETTO" )
Example
$vtimezonedlght->deleteProperty( "TZOFFSETTO" );
Format 1
getProperty( "TZOFFSETTO" )
output = tzoffsetto1
Format 2
getProperty( "TZOFFSETTO", FALSE , TRUE )
output = array( "value" => tzoffsetto1 , "params" => xparam2 )
Example
$tzoffsetto = $timezonestandard->getProperty( "TZOFFSETTO" );
Format
setproperty( "tzoffsetto", tzoffsetto [, xparam ] )
tzoffsetto1 = (+/-)HHmm[ss], UTC offset xparam2 = array( *[ xparamkey => xparamvalue ] )
Example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $timezone = new vtimezone(); $timezone->setProperty( "Tzid", "US-Eastern" ); $timezone->setProperty( "Last-Modified", "19870101" ); $timezonestandard = new vtimezone( "standard" ); .. . $timezonedaylight = new vtimezone( "daylight" ); $timezonedaylight->setProperty( "tzoffsetto", "1345" ); .. .
Format
deleteProperty( "TZURL" )
Example
$vtimezone->deleteProperty( "TZURL" );
Format 1
getProperty( "TZURL" )
output = tzurl1
Format 2
getProperty( "TZURL", FALSE , TRUE )
output = array( "value" => tzurl1 , "params" => xparam2 )
Example
$tzurl = $timezonestandard->getProperty( "TZURL" );
Format
setProperty( "tzurl", tzurl [, xparam ] )
tzurl1 = Value type URI xparam2 = array( *[ xparamkey => xparamvalue ] )
Example
$tz = "http://zones.stds_r_us.net/tz/US-Eastern" ); $vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $timezone = new vtimezone(); $timezone->setProperty( "Tzid", "US-Eastern" ); $timezone->setProperty( "Last-Modified", "19870101T000000" ); $timezone->setProperty( "tzurl", $tz ); .. .
Format
deleteProperty( "UID" )
Example
$vevent->deleteProperty( "UID" );
Format 1
getProperty( "UID" )
output = uid1
Format 2
getProperty( "UID", FALSE , TRUE )
output = array( "value" => uid1 , "params" => xparam2 )
Example
$uid = $vevent->getProperty( "UID" );
Format
setProperty( "uid", uid [, xparam ] )
uid1 = Value type TEXT xparam2 = array( *[ xparamkey => xparamvalue ] )
Example
$vevent->setProperty("uid","20070803T194810CEST-0123U3PXiX@domain.com");
Format
deleteProperty( "URL" )
Example
$vevent->deleteProperty( "URL" );
Format 1
getProperty( "URL" )
output = url1
Format 2
getProperty( "URL", FALSE , TRUE )
output = array "value" => url1 , "params" => xparam2 )
Example
$url = $vevent->getProperty( "URL" );
Format
setProperty( "url", url [, xparam ] )
url1 = Value type URI xparam2 = array( *[ xparamkey => xparamvalue ] (
Example
$vtodo->setProperty( "url", "http://www.icaldomain.net" );
Format
deleteProperty( "<X-PROPERTY>" )
Example 1
$vevent->deleteProperty( "<X-PROPERTY>" );
Example 2
Deleting all x-properties.while( $vevent->deleteProperty()) continue;
Format 1
getProperty()
output = array( propertyName1 , propertyData2 )
Format 2
getProperty( FALSE, propOrderNo/FALSE, TRUE )
output = array( propertyName1 , array ( "value" => propertyData2 ) , "params" => params 3))
Format 3
getProperty( FALSE, propOrderNo )
Get propOrderNo X-property
Example 1
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); while( $xprop = $vcalendar->getProperty( )) { .. .
// $xprop = array( propertyName1, propertyData2 )
Example 2
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); while( $xprop = $vcalendar->getProperty( "X-ABC-MMSUBJ" )) { .. .
// $xprop = array( "X-ABC-MMSUBJ", propertyData2 )
Example 3
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); while( $xprop = $vcalendar->getProperty( FALSE, FALSE, TRUE )) { .. .
// $xprop = array( propertyName1 // , array( "value" => propertyData2 ) // , "params" => params 3 )
Format
setProperty( propertyName, propertyData [, params ] )
propertyName1 = Any property name with a "X-" prefix propertyData2 = Value type TEXT params3 = array( ["LANGUAGE" => "<lang>"] [, xparam] ) xparam = *[ xparamkey => xparamvalue ]
propOrderNo = int ordernumber, 1=1st, 2=2nd etcExample
$component->setProperty("X-ABC-MMSUBJ","http://load.noise.org/mysubj.wav");
Format
getConfig( "language" )
Example
$lang = $vevent->getConfig( "language" );
Format
setConfig( "language", string <lang> )
Example
$vevent->setConfig( "language", "en" );
Format
deleteComponent( int orderNumber )
Remove component with order number (1st=1, 2nd=2.. .).
deleteComponent( string componentType [, int componentSuborderNumber])
Remove component with component type (ex. "vevent") and order 1 alt. suborder number.
deleteComponent( string UID )
Remove component with UID. N.B UID is NOT set for ALARM / timzone components.
Example 1
Delete first subcomponent.$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); $comp1 = $vcalendar->getComponent(); $comp1->deleteComponent( 1 ); .. .
Example 2
Delete all subcomponents.$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); $comp1 = $vcalendar->getComponent(); while( $comp1->deleteComponent( 'valarm' ) continue; .. .
Format 1
getComponent()
Get next component until end-of-components.
Format 2
getComponent( int orderNumber )
Get component with order number (1st=1, 2nd=2.. .).
Format 3
getComponent( string componentType [, int componentSuborderNumber])
Get (next) component with component type (until end-of-components) alt. component with component type and suborder number (1st=1, 2nd=2..).
Format 4
getComponent( string UID )
Get component with UID. N.B UID is NOT set for ALARM / timzone components.
Example
$vcalendar = new vcalendar(); $vcalendar->setConfig( "unique_id", "domain.com" ); $vcalendar->setConfig( "filename", "file.ics" ); $vcalendar->parse(); $vcalendar->parse( "file.ics" ); $comp1 = $vcalendar->getComponent()); while( $subComp = $comp1->getComponent()) { .. .
Format 1
setComponent( component ) addSubComponent( component ) // alias
Insert last in component chain.
Format 2
setComponent( component, int orderNumber )
Replace component with order number(1st=1, 2nd=2.. .). If orderNumber is not found, component is inserted last in chain.
Format 3
setComponent( component, string componentType [,component suborder number])
Replace component with component type and component order number. if orderNumber is not found, component is inserted last in chain.
Format 4
setComponent( component, string UID )
Replace component with UID. N.B UID is NOT set for ALARM / timzone components.
Example
$vcalendar = new vcalendar(); // initiate new CALENDAR $vcalendar->setConfig( "unique_id", "domain.com" ); .. . $vevent = new vevent(); // initiate EVENT $vevent->setProperty( "dtstart" // add some EVENT properties , 2006, 12, 24, 19, 30, 00 ); $vevent->setProperty(.. . .. . $valarm = new valarm(); // initiate ALARM and set some properties $valarm->setProperty( "trigger", .. . .. . $vevent->setComponent ( $valarm ); // add ALARM to .. .