iCalcreator v2.26.8

iCalcreator v2.26.8
Copyright © 2007-2019 Kjell-Inge Gustafsson, kigkonsult, All rights reserved.
kigkonsult.se iCalcreator
Contact : iCal_at_kigkonsult_dot_se

## Preface

This document describes usage of iCalcreator, the PHP software implementation of standards rfc5545/ rfc5546 (rfc2445/rfc2446) to manage iCal formatted files.

This document is provided by kigkonsult for informational purposes and is provided on an "as is" basis without any warranties expressed or implied.

Information in this document is subject to change without notice and does not represent a commitment on the part of kigkonsult. The software described in this document is provided under a license agreement. The software may be used only in accordance with the terms of that license agreement. It is against the law to copy or use the software except as specifically allowed in the license agreement.

It is the users responsibility to ensure the suitability of the software before using it. In no circumstances will kigkonsult be responsible for the use of the software's outcomes or results or any loss or damage of data or programs as a result of using the software.

The use of the software implies acceptance of these terms and the license.

This document makes previous versions obsolete.

[index]

# 1 INTRO

iCalcreator is a PHP class package managing iCal files, supporting (non-)calendar systems and applications to process and communicate calendar information like events, agendas, tasks, reports, totos and journaling information.

The iCal standards are rfc5545/rfc5546 (rfc2445/rfc2446).

iCalcreator features create, parse, edit and select calendar and calendar components.

For iCalcreator 2.26.8 version (and later), PHP version >= 5.6 is required.

[index] [top]

## 1.1 Standards

#### iCal

A short iCal description is found at Wikipedia. If You are not familiar with iCal, read this first!

The iCalendar format, iCal, are described in

rfc5545
  "Internet Calendaring and Scheduling Core Object Specification (iCalendar)"
rfc5546
  "iCalendar Transport-Independent Interoperability Protocol (iTIP)"
  Scheduling Events, BusyTime, To-dos and Journal Entries

  . ..allows for the capture and exchange of information normally stored within a calendaring and scheduling application.

  and

  . ..is an exchange format between applications or systems.

rfc5545 and rfc5546 obsoletes, respectively, rfc2445 and rfc2446.

Any references to rfc2445, below, corresponds to rfc5545.

#### xCal

iCalcreator also supports xCal (iCal xml), rfc6321, The XML Format for iCalendar.

A short xCal description is found at Wikipedia.

[index] [top]

## 1.2 This manual

This style is used for text.

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/5545 quotes.

[index] [top]

## 1.3 Versioning

The release numbering convention used is major.minor(.micro / suffix).

Major
  Indicates a very large change in the core package. Rewrites or major milestones.
Minor
  Significant amount of feature addition/modification.
  odd number - development/experimental release
  even number - production release
Micro
  Primarily bug fix and maintenance number.
Suffix
  rc1 for first release candidate etc.

The release plan is based on yearly releases with exception of emergency releases.

[index] [top]

## 1.4 Support

For support report, use github issues.

For non emergency issues, support upon (paid) request only.

kigkonsult offer professional services for software support, design and new/re-development and unit tests of PHP/MySQL solutions with focus on software lifecycle management, including long term utility, reliability and maintainability.

[index] [top]

## 1.5 Donate

You can show your appreciation for our free software, and can support future development by making a donation to the kigkonsult project iCalcreator.

Make a donation of any size by clicking here. Thanks in advance!

[index] [top]

## 1.6 Install

Composer (https://getcomposer.org/)
  composer require kigkonsult/icalcreator
Or
  include the (download) iCalcreator folder to your include-path
  Add
  require_once "[path/]iCalcreator-2.26.8/autoload.php";
  to your PHP-script.
  The iCalcreator invoker has changed since previous version!

iCalcreator 2.26.8 is using namespace "Kigkonsult\Icalcreator".

You may need to set the default timezone. When creating a new Vcalendar/component instance, review config settings.

There are free iCal icons (use as buttons on a web page?) to download here.

[index] [top]

## 1.7 Release plan

A brief release plan, changable...
Bugs are fixed as soon as possible upon priority or severity.

v2.28
  Exception error management
  Method chaining, appropriate methods like set-methods etc where relevant
v2.30
  Removal of all set-methods date(time)/interval array arguments
  as well as (most) get-methods return date(time)/interval array formats
  Alter
  - Vcalendar::parse()
  only string allowed, removing internal iCal file/url parse method
  Replacing methods
  - Vcalendar::saveCalendar()
  - Vcalendar::returnCalendar()
  - Vcalendar::useCachedCalendar()
  by new external iCal file/url acquire/dispose handler(s)

[index] [top]

## 1.8 Additional Descriptors

Some properties (ex. as described in wikipedia:iCal) may be required when importing iCal files into some calendaring software (MS etc). Also X-properties may appear in exports. Below are examples

on calendar level
  METHOD property (value PUBLISH etc.)
  X-WR-CALNAME x-property
  X-WR-CALDESC x-property
  X-WR-RELCALID x-property (Read more info about UUID.)
  X-WR-TIMEZONE x-property
on component level
  DTSTAMP *
  UID *
on component level in a vtimezone component
  X-LIC-LOCATION x-property

* Created automatically in iCalcreator, if not set.

To ease up usage,
Kigkonsult\Icalcreator\Util\Util::$X_WR_CALNAME ('X-WR-CALNAME'),
Kigkonsult\Icalcreator\Util\Util::$X_WR_CALDESC (X-WR-CALDESC'),
Kigkonsult\Icalcreator\Util\Util::$X_WR_RELCALID (X-WR-RELCALID'),
Kigkonsult\Icalcreator\Util\Util::$X_WR_TIMEZONE (X-WR-TIMEZONE'),
Kigkonsult\Icalcreator\Util\Util::$X_LIC_LOCATION (X-LIC-LOCATION')
as used in code snippets (below) are available.

Example

A strong recommendation is also to set config unique_id when creating a new Vcalendar/component instance, to ensure accurate setting of all components UID property, also before parse. Also setting of config timezone ("TZID" and "X-WR-TIMEZONE" below) is to recommend.

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vcalendar->setProperty( Kigkonsult\Icalcreator\Util\Util::$METHOD, "PUBLISH" ); $vcalendar->setProperty( Kigkonsult\Icalcreator\Util\Util::$X_WR_CALNAME, "Calendar Sample" ); $vcalendar->setProperty( Kigkonsult\Icalcreator\Util\Util::$X_WR_CALDESC, "Calendar Description" ); $vcalendar->setProperty( Kigkonsult\Icalcreator\Util\Util::$X_WR_RELCALID, "3E26604A-50F4-4449-8B3E-E4F4932D05B5" ); $vcalendar->setProperty( Kigkonsult\Icalcreator\Util\Util::$X_WR_TIMEZONE, "Europe/Stockholm" );

[index] [top]

## 1.9 INDEX

1 INTRO
1.1 Standards
1.2 This manual
1.3 Versioning
1.4 Support
1.5 Donate
1.6 Install
1.7 Release plan
1.8 Additional_Descriptors
1.9 INDEX
2 Calendar Component list
2.1 VCALENDAR
2.2 VEVENT
2.3 VTODO
2.4 VJOURNAL
2.5 VFREEBUSY
2.6 VALARM
2.7 VTIMEZONE
2.8 Component Properties
3 Function list
3.1 Vcalendar methods
3.1.1 Constructors
3.1.1.1 Vcalendar
3.1.1.2 Vevent
3.1.1.3 Vtodo
3.1.1.4 Vjournal
3.1.1.5 Vfreebusy
3.1.1.6 Valarm
3.1.1.7 Vtimezone
3.1.1.8 Standard / Daylight
3.1.2 Vcalendar property methods
3.1.2.1 deleteProperty
3.1.2.2 getProperty
3.1.2.3 setProperty
3.1.2.4 CALSCALE
3.1.2.5 METHOD
3.1.2.6 VERSION
3.1.2.7 X-PROPERTY
3.1.3 Vcalendar component object methods
3.1.3.1 deleteComponent
3.1.3.2 getComponent
3.1.3.3 newComponent
3.1.3.4 replaceComponent
3.1.3.5 selectComponents
3.1.3.6 setComponent
3.1.4 Vcalendar calendar methods
3.1.4.1 parse and merge
3.1.4.2 createCalendar
3.1.4.3 returnCalendar
3.1.4.4 saveCalendar
3.1.4.5 sort
3.1.4.6 useCachedCalendar
3.1.4.7 iCalcreatorVersion
3.1.5 Vcalendar configuration
3.1.5.1 configuration keys
3.1.5.2 getConfig
3.1.5.3 calendar/component initialization
3.1.5.4 setConfig
3.1.5.5 Allow empty components
3.1.5.6 Component information
3.1.5.7 Delimiter
3.1.5.8 Directory
3.1.5.9 Dirfile
3.1.5.10 Fileinfo
3.1.5.11 Filename
3.1.5.12 Filesize
3.1.5.13 Language
3.1.5.14 setPropertyNames
3.1.5.15 TZID
3.1.5.16 Unique_id
3.1.5.17 URL
3.2 Component property methods
3.2.1 deleteProperty
3.2.2 getProperty
3.2.3 parse
3.2.4 setProperty

Ascending property order
  3.2.5 ACTION
  3.2.6 ATTACH
  3.2.7 ATTENDEE
  3.2.8 CATEGORIES
  3.2.9 CLASS
  3.2.10 COMMENT
  3.2.11 COMPLETED
  3.2.12 CONTACT
  3.2.13 CREATED
  3.2.14 DESCRIPTION
  3.2.15 DTEND
  3.2.16 DTSTAMP
  3.2.17 DTSTART
  3.2.18 DUE
  3.2.19 DURATION
  3.2.20 EXDATE
  3.2.21 EXRULE
  3.2.22 FREEBUSY
  3.2.23 GEO
  3.2.24 LAST-MODIFIED
  3.2.25 LOCATION
  3.2.26 ORGANIZER
  3.2.27 PERCENT-COMPLETE
  3.2.28 PRIORITY
  3.2.29 RDATE
  3.2.30 RECURRENCE-ID
  3.2.31 RELATED-TO
  3.2.32 REPEAT
  3.2.33 REQUEST-STATUS
  3.2.34 RESOURCES
  3.2.35 RRULE
  3.2.36 SEQUENCE
  3.2.37 STATUS
  3.2.38 SUMMARY
  3.2.39 TRANSP
  3.2.40 TRIGGER
  3.2.41 TZID
  3.2.42 TZNAME
  3.2.43 TZOFFSETFROM
  3.2.44 TZOFFSETTO
  3.2.45 TZURL
  3.2.46 UID
  3.2.47 URL
  3.2.48 X-PROPERTY
Descriptive Component Properties
  3.2.6 ATTACH
  3.2.8 CATEGORIES
  3.2.10 COMMENT
  3.2.14 DESCRIPTION
  3.2.23 GEO
  3.2.25 LOCATION
  3.2.27 PERCENT-COMPLETE
  3.2.28 PRIORITY
  3.2.34 RESOURCES
  3.2.37 STATUS
  3.2.38 SUMMARY
Date and Time Component Properties
  3.2.11 COMPLETED
  3.2.15 DTEND
  3.2.18 DUE
  3.2.17 DTSTART
  3.2.19 DURATION
  3.2.22 FREEBUSY
  3.2.39 TRANSP
Time Zone Component Properties
  3.2.41 TZID
  3.2.42 TZNAME
  3.2.43 TZOFFSETFROM
  3.2.44 TZOFFSETTO
  3.2.45 TZURL
Relationship Component Properties
  3.2.7 ATTENDEE
  3.2.12 CONTACT
  3.2.26 ORGANIZER
  3.2.30 RECURRENCE-ID
  3.2.31 RELATED-TO
  3.2.47 URL
  3.2.46 UID
Recurrence Component Properties
  3.2.20 EXDATE
  3.2.29 RDATE
  3.2.35 RRULE
Alarm Component Properties
  3.2.5 ACTION
  3.2.32 REPEAT
  3.2.40 TRIGGER
Change Management Component Properties
  3.2.13 CREATED
  3.2.16 DTSTAMP
  3.2.24 LAST-MODIFIED
  3.2.36 SEQUENCE
Miscellaneous Component Properties
  3.2.48 X-PROPERTY
  3.2.33 REQUEST-STATUS

3.3 iCalcreator Component configuration methods
3.3.1 Language
3.4 iCalcreator component object misc. methods
3.4.1 deleteComponent
3.4.2 getComponent
3.4.3 newComponent
3.4.4 setComponent
4 Timezone, XML, json and vCard support
4.1 iCalcreator and timezoneHandler class
4.1.1 createTimezone
4.1.2 ms2phpTZ
4.1.3 transformDateTime
4.2 Timezone helper functions
4.2.1 getTzOffsetForDate
4.2.2 getTimezonesAsDateArrays
4.3 iCalcreator and iCalXML class
4.3.1 iCal2XML
4.3.2 XML2iCal
4.4 iCalcreator and json export
4.5 iCalcreator and iCalvCard class
4.5.1 iCal2vCard
4.5.2 iCal2vCards
5 COPYRIGHT AND LICENSE
[index] [top]

# 2 Calendar Component list

To ease up usage, You will find convenient holders for properties and config keys etc in top of the "util" class file (src/util/util.php), used in code snippets.

Quote from RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar)!

## 2.1 VCALENDAR

icalobject = 1*("BEGIN" ":" "VCALENDAR" CRLF

icalbody

"END" ":" "VCALENDAR" CRLF)

icalbody = calprops component

calprops = 2*(

"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

calscale / method /

x-prop

)

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

[index] [top] [up]

## 2.2 VEVENT

"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"

dtend / duration /

the following are optional, and MAY occur more than once

attach / attendee / categories / comment /

contact / exdate / exrule / rstatus /

related / resources / rdate / rrule / x-prop

)

[index] [top] [up]

## 2.3 VTODO

"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"

due / duration /

the following are optional,and MAY occur more than once

attach / attendee / categories / comment /

contact / exdate / exrule / rstatus /

related / resources / rdate / rrule / x-prop

)

[index] [top] [up]

## 2.4 VJOURNAL

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

)

[index] [top] [up]

## 2.5 VFREEBUSY

"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

)

[index] [top] [up]

## 2.6 VALARM

"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

action / trigger /

"duration" and "repeat" are both optional,and MUST NOT occur more than once each,

but if one occurs, so MUST the other

duration / repeat /

the following is optional, but MUST NOT occur more than once

attach /

the following is optional, and MAY occur more than once

x-prop

)

dispprop = 3*(

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

duration / repeat /

the following is optional, and MAY occur more than once

x-prop

)

emailprop = 5*(

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

duration / repeat /

the following are optional, and MAY occur more than once

attach / x-prop

)

procprop = 3*(

the following are all REQUIRED, but MUST NOT occur more than once

action / attach / trigger /

"duration" and "repeat" are both optional, and MUST NOT occur more than once each,

but if one occurs, so MUST the other

duration / repeat /

"description" is optional, and MUST NOT occur more than once

description /

the following is optional, and MAY occur more than once

x-prop

)

[index] [top] [up]

## 2.7 VTIMEZONE

"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

last-mod / tzurl /

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

x-prop

)

"END" ":" "VTIMEZONE" CRLF

standardc = "BEGIN" ":" "STANDARD" CRLF

tzprop

"END" ":" "STANDARD" CRLF

daylightc = "BEGIN" ":" "DAYLIGHT" CRLF

tzprop

"END" ":" "DAYLIGHT" CRLF

tzprop = 3*(

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

)

[index] [top] [up]

## 2.8 Component Properties

A comprehensive table showing relation between calendar components and properties. vtimezone properties are not included.

0-1 | OPTIONAL property, MUST NOT occur more than once.
0-m | OPTIONAL property, MAY occur more than once.
0 / 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.
| v e v e n t | v t o d o | v j o u r n a l | v f r e e b u s y | v a l a r m
| a u d i o | d i s p l a y | e m a i l | p r o c e d u r e
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 |  |  |  |
completed |  | 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 / 1=1 | 0 / 1=1 | 0 / 1=1 | 0 / 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 / 1=1 | 0 / 1=1 | 0 / 1=1 | 0 / 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, the DTSTAMP and UID properties are automatically created by iCalcreator
for vevent, vtodo, vjournal and vfreebusy components
when using Vcalendar methods saveCalendar (or returnCalendar)
or when fetching DTSTAMP/UID property value with the component method getProperty.

[index] [top] [up]

# 3 Function list

## 3.1 Vcalendar methods

### 3.1.1 Constructors

#### 3.1.1.1 Vcalendar

Create a new VCALENDAR object.

Format

vcalendar::vcalendar( [ config ] )

config = array, review configuration options.

Basic example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config );

The calendar property PRODID and each component property UID are AUTOMATICALLY generated in iCalcreator, if not set manually, and based on the configuration unique_id.

Extended example

$tz = "Europe/Stockholm" $config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se" Kigkonsult\Icalcreator\Util\Util::$TZID => $tz ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vcalendar->setProperty( "X-WR-TIMEZONE", $tz ); // insert components or parse an iCal file (and edit components) $xprops = [ Kigkonsult\Icalcreator\Util\Util::$X_LIC_LOCATION => $tz ]; kigkonsult\iCalcreator\TimezoneHandler::createTimezone( $vcalendar, $tz, $xprops );

The TZID config key and value (timezone) is supplied when setting DTSTART, DTEND, DUE or RECURRENCE-ID, if not set manually, a TZID auto completion.

Some calendar software may also require calendar property X-WR-TIMEZONE and vtimezone component with property X-LIC-LOCATION, review createTimezone, a method in the TimezoneHandler class.

Do NOT set directory/filename in vcalendar constructor, due to inability to detect error (bool false) config return.

[index] [top] [up]

#### 3.1.1.2 Vevent

Format 1

Create a new VEVENT object using an Vcalendar component factory-method, returning a reference to the new component.

To ease up usage, constant Kigkonsult\Icalcreator\Vcalendar::VEVENT as used in code snippets is available.

vcalendar::newComponent( "vevent" )

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vevent = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VEVENT ); $vevent->setProperty( .. .

You can also use a convenient vcalendar::newComponent() method wrapper, like:

vcalendar::newVevent()

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vevent = $vcalendar->newVevent(); $vevent->setProperty( .. .

Format 2

Create a new VEVENT object.

vevent::vevent( [ config ] )

config = array, review configuration options.

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $config = $vcalendar->getConfig(); $vevent = new Kigkonsult\Icalcreator\Vevent( $config ); $vevent->setProperty( .. . $vcalendar->setComponent( $vevent );

[index] [top] [up]

#### 3.1.1.3 Vtodo

Format 1

Create a new VTODO object using an Vcalendar component factory-method, returning a reference to the new component.

To ease up usage, constant Kigkonsult\Icalcreator\Vcalendar::VTODO as used in code snippets is available.

vcalendar::newComponent( "vtodo" )

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vtodo = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VTODO ); $vtodo->setProperty( .. .

You can also use a convenient vcalendar::newComponent() method wrapper, like:

vcalendar::newVtodo()

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vtodo = $vcalendar->newVtodo(); $vtodo->setProperty( .. .

Format 2

Create a new VTODO object.

vtodo::vtodo( [ config ] )

config = array, review configuration options.

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vtodo = new Kigkonsult\Icalcreator\Vtodo( $vcalendar->getConfig()); $vtodo->setProperty( .. . $vcalendar->setComponent( $vtodo );

[index] [top] [up]

#### 3.1.1.4 Vjournal

Format 1

Create a new VJOURNAL object using an Vcalendar factory-method, returning a reference to the new component.

To ease up usage, constant Kigkonsult\Icalcreator\Vcalendar::VJOURNAL as used in code snippets is available.

vcalendar::newComponent( "vjournal" )

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vjournal = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VJOURNAL ); $vjournal->setProperty( .. .

You can also use a convenient vcalendar::newComponent() method wrapper, like:

vcalendar::newVjournal()

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vjournal = $vcalendar->newVjournal(); $vjournal->setProperty( .. .

Format 2

Create a new VJOURNAL object.

vjournal::vjournal( [ config ] )

config = array, review configuration options.

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vjournal = new Kigkonsult\Icalcreator\Vjournal( $vcalendar->getConfig()); $vjournal->setProperty( .. . $vcalendar->setComponent( $vjournal );

[index] [top] [up]

#### 3.1.1.5 Vfreebusy

Format 1

Create a new VFREEBUSY object using an Vcalendar factory-method, returning a reference to the new component.

To ease up usage, constant Kigkonsult\Icalcreator\Vcalendar::VFREEBUSY as used in code snippets is available.

vcalendar::newComponent( "vfreebusy" )

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vfreebusy = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VFREEBUSY ); $vfreebusy->setProperty( .. .

You can also use a convenient vcalendar::newComponent() method wrapper, like:

vcalendar::newVfreebusy()

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vfreebusy = $vcalendar->newVfreebusy(); $vfreebusy->setProperty( .. .

Format 2

Create a new VFREEBUSY object.

vfreebusy::vfreebusy( [ config ] )

config = array, review configuration options.

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vfreebusy = new Kigkonsult\Icalcreator\Vfreebusy( $vcalendar->getConfig()); $vfreebusy->setProperty( .. . $vcalendar->setComponent( $vfreebusy );

[index] [top] [up]

#### 3.1.1.6 Valarm

Format 1

Create a new VALARM object using an Vcalendar component factory-method, returning a reference to the new (sub-)component. The VALARM calendar component MUST only appear (one or more, mutually independent) within either a VEVENT or VTODO calendar component.

To ease up usage, constant Kigkonsult\Icalcreator\Vcalendar::VALARM as used in code snippets is available.

calendarComponent::newComponent( "valarm" )

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vevent = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VEVENT ); $vevent->setProperty( .. . $valarm = $vevent->newComponent( Kigkonsult\Icalcreator\Vcalendar::VALARM ); $valarm->setProperty( .. .

You can also use a convenient calendarComponent::newComponent() method wrapper, like:

calendarComponent::newValarm()

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vevent = $vcalendar->newVevent(); $vevent->setProperty( .. . $valarm = $vevent->newValarm(); $valarm->setProperty( .. .

Format 2

Create a new VALARM object.

valarm::valarm( [ config ] )

config = array, review configuration options.

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vevent = new Kigkonsult\Icalcreator\Vevent(); $vevent->setProperty( .. . $valarm = new Kigkonsult\Icalcreator\Valarm( $vevent->getConfig()); $valarm->setProperty( .. . $vevent->setComponent( $valarm ); $vcalendar->setComponent( $vevent );

[index] [top] [up]

#### 3.1.1.7 Vtimezone

The vtimezone component describe, at a minimum, the base offset from UTC for the time zone. For dates with UTC DATE-TIME, read this!

To ease up usage, constant Kigkonsult\Icalcreator\Vcalendar::VTIMEZONE as used in code snippets is available.

Format 1

Create a new VTIMEZONE object using an Vcalendar component factory-method, returning a reference to the new component.

vcalendar::newComponent( "vtimezone" )

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vtimezone = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VTIMEZONE ); $vtimezone->setProperty( .. .

You can also use a convenient vcalendar::newComponent() method wrapper, like:

vcalendar::newVtimezone()

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vtimezone = $vcalendar->newVtimezone(); $vtimezone->setProperty( .. .

Format 2

Create a new VTIMEZONE object.

vtimezone::vtimezone( [ config ] )

config = array, review configuration options.

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vtimezone = new Kigkonsult\Icalcreator\Vtimezone( $vcalendar->getConfig()); $vtimezone->setProperty( .. . $vcalendar->setComponent( $vtimezone );

##### Creation of timezone components

It is possible to create timezone components, using a method in TimezoneHandler class, createTimezone and utilizing the PHP DateTimeZone class.

[index] [top] [up]

#### 3.1.1.8 Standard / Daylight

Format 1

Create a new VTIMEZONE standard / daylight objects using an Vcalendar component factory-method, returning a reference to the new (sub-)component.

To ease up usage, constants Kigkonsult\Icalcreator\Vcalendar::STANDARD and Kigkonsult\Icalcreator\Vcalendar::DAYLIGHT as used in code snippets are available.

vtimezone::newComponent( "standard" )

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vtimezone = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VTIMEZONE ); $vtimezone->setProperty( .. . $standard = $vtimezone->newComponent( Kigkonsult\Icalcreator\Vcalendar::STANDARD ); $standard->setProperty( .. . $daylight = $vtimezone->newComponent( Kigkonsult\Icalcreator\Vcalendar::DAYLIGHT ); $daylight->setProperty( .. .

You can also use convenient vcalendar::newComponent() method wrappers, like:

vtimezone::newStandard()

vtimezone::newDaylight()

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vtimezone = $vcalendar->newVtimezone(); $vtimezone->setProperty( .. . $standard = $vtimezone->newStandard(); $standard->setProperty( .. . $daylight = $vtimezone->newDaylight(); $daylight->setProperty( .. .

Format 2

Create a new VTIMEZONE STANDARD object.

vtimezone::vtimezone( "standard" [, config ] )

config = array, review configuration options.

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vtimezone = new Kigkonsult\Icalcreator\Vtimezone( $vcalendar->getConfig()); $vtimezone->setProperty( .. . $standard = new Kigkonsult\Icalcreator\Vtimezone( Kigkonsult\Icalcreator\Vcalendar::STANDARD, $vtimezone->getConfig() ); $standard->setProperty( .. . $vtimezone->setComponent( $standard ); $daylight = new Kigkonsult\Icalcreator\Vtimezone( Kigkonsult\Icalcreator\Vcalendar::DAYLIGHT, $vtimezone->getConfig() ); $daylight->setProperty( .. . $vtimezone->setComponent( $daylight ); $vcalendar->setComponent( $vtimezone );

[index] [top] [up]

### 3.1.2 Vcalendar property methods

#### 3.1.2.1 deleteProperty

Generic Vcalendar deleteProperty method, simplifying removal of calendar properties.

Bool false is returned if no property exists or when end-of-properties at consecutive method calls.

Format

vcalendar::deleteProperty( [ PropName [, order=1 ] )

propName = (string) case independent, [RFC5545] component property names, unknown/missing propName will be regarded as X-property. order = (int) if missing 1st/next occurrence, used with multiple (property) occurrences

Example

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); if( ! $vcalendar->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$METHOD )) { echo "METHOD property not found"; }

[index] [top] [up]

#### 3.1.2.2 getProperty

Format 1

Generic iCalcreator getProperty method, simplifying fetch of calendar properties.

Bool false is returned if no property exists or when end-of-properties at consecutive method calls.

vcalendar::getProperty( [ PropName [, order=1 [, complete=false ]]] )

propName = (string) case independent, [RFC5545] component property names, unknown/missing propName will be regarded as X-property. order = (int) if missing 1st/next occurrence, used with multiply (property) occurrences complete = (bool) false (default) : output only property value true : output = [ "value"=> <value> ,"params" => <parameter array>]

Example 1

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); $calscale = $vcalendar->getProperty( Kigkonsult\Icalcreator\Util\Util::$CALSCALE );

Example 2

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); while( $xprop = $vcalendar->getProperty( )) { // get x-properties .. . }

Format 2

Ability to fetch specific component property (unique) value(-s) and number of occurrence(-s). The search includes ALL components within the Vcalendar instance.

Outputs an array( *[ (string) unique-property-value => (int) number_of_occurrence ] ) or an empty array if no hits. The array is sorted by (asc.) key. If a property contains multiple values (like "CATAGORIES:course1,courseB" or "RESOURCES:pc,camera"), they are split into unique values.

Supported Descriptive Component Properties
  CATEGORIES
  LOCATION
  GEOLOCATION *1
  PRIORITY
  RESOURCES
  STATUS
  SUMMARY
Supported Date and Time Component Property
  DTSTART *2
Supported Relationship Component Properties
  ATTENDEE *3
  CONTACT
  ORGANIZER *3
  RECURRENCE-ID *4 (alt. "R-UID")
  RELATED-TO
  URL
  UID

*1
  Using the non-standard directive "GEOLOCATION", iCalcreator returns output supporting
  ISO6709 "Standard representation of geographic point location by coordinates",
  by combining the LOCATION and GEO property values (only if GEO is set).
*2
  Using DTSTART as argument returns dates in format "YYYYMMDD" (please note, dates within a RDATE/RRULE recurrence set are NOT included, only the origin start date (DTSTART)).
*3
  The ATTENDEE and ORGANIZER output values are prefixed by "protocol" like "MAILTO:chair@kigkonsult.se".
*4
  Using "RECURRENCE-ID-UID" returns UID values for component(-s) where RECURRENCE-ID is set.

To ease up usage, property name holders are found in top of the "util" class (src/util.php).

To select components based on property values, use selectComponents (Format 2).

To get components based on property values, use getComponent (Format 5).

To get component property values, use getProperty.

vcalendar::getProperty( PropName )

propName = (string) case independent, property name

Example 1

Fetch all attendees in the Vcalendar instance.

$attendees = $vcalendar->getProperty( Kigkonsult\Icalcreator\Util\Util::$ATTENDEE ); foreach( $attendees as $attendee => $occurrCount ) { .. .

Example 2

Fetch all DTSTARTs in the Vcalendar instance.

$startDates = $vcalendar->getProperty( Kigkonsult\Icalcreator\Util\Util::$DTSTART ); foreach( $startDates as $startDate => $occurrCount ) { .. .

[index] [top] [up]

#### 3.1.2.3 setProperty

Generic the Vcalendar setProperty method,simplifying insert of calendar properties.

A successful update returns true.

Format

vcalendar::setProperty( PropName, Proparg_1 *[, Proparg_n] )

propName = (string) case independent, strict [RFC5545] calendar property names, unknown propName will be regarded as (a non-standard) X-property. Proparg = (mixed) property argument Last property argument is a (optional) property dependent parameters array( *[(string) key => (string) value ] ). A non-standard (, experimental) parameter key MUST be prefixed by "X-".

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar(); // initiate new CALENDAR $vcalendar->setConfig( $config ); $vcalendar->setProperty( Kigkonsult\Icalcreator\Util\Util::$CALSCALE, "GREGORIAN" );

[index] [top] [up]

#### 3.1.2.4 CALSCALE

This property defines the calendar scale used for the calendar information specified in the iCalendar object.

The default value is "GREGORIAN", implied when missing.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$CALSCALE as used in code snippets is available.

##### Create CALSCALE

If set, returns [RFC5545] formatted string, otherwise null.

Format

vcalendar::createCalscale()

Example

$str = $vcalendar->createCalscale();

##### Delete CALSCALE

Remove CALSCALE from calendar.

Format

vcalendar::deleteProperty( "calscale" )

Example

$vcalendar->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$CALSCALE );

##### Get Calscale

If set, returns property value, otherwise bool false.

Format

vcalendar::getProperty( "calscale" )

Example

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); $calscale = $vcalendar->getProperty( Kigkonsult\Icalcreator\Util\Util::$CALSCALE );

##### Set CALSCALE

Set property value.

Format

vcalendar::setProperty( "calscale", value )

value = (string) calscale value

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); // initiate new CALENDAR $vcalendar->setProperty( Kigkonsult\Icalcreator\Util\Util::$CALSCALE, "GREGORIAN" );

[index] [top] [up]

#### 3.1.2.5 METHOD

This property defines the iCalendar object method associated with the calendar object.

METHOD property (value PUBLISH etc.) may be required when importing iCal files into some calendaring software (MS etc.), as well as x-properties "X-WR-CALNAME", "X-WR-CALDESC" and "X-WR-TIMEZONE" and the (automatically created) DTSTAMP and UID properties.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$METHOD as used in code snippets is available.

##### Create METHOD

If set, returns [RFC5545] formatted string, otherwise null.

Format

vcalendar::createMethod()

Example

$str = $vcalendar->createMethod();

##### Delete METHOD

Remove METHOD from calendar.

Format

vcalendar::deleteProperty( "METHOD" )

Example

$vcalendar->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$METHOD );

##### Get METHOD

If set, returns property value, otherwise bool false.

Format

vcalendar::getProperty( "method" );

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vcalendar->parse(); $method = $vcalendar->getProperty( Kigkonsult\Icalcreator\Util\Util::$METHOD );

##### Set METHOD

Set property value.

Format

vcalendar::setProperty( "method", value )

value = (string) method value

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); // initiate new CALENDAR $vcalendar->setProperty( Kigkonsult\Icalcreator\Util\Util::$METHOD, "PUBLISH" );

[index] [top] [up]

#### 3.1.2.6 VERSION

This property specifies the identifier corresponding to the version number of the iCalendar specification. This property is always placed first in the calendar file.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$VERSION as used in code snippets is available.

##### Create Version

If set, returns [RFC5545] formatted string, otherwise null.

Format

vcalendar::createVersion()

Example

$str = $vcalendar->createVersion();

##### Get Version

Fetch property value.

Format

vcalendar::getProperty( "version" )

Example

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); $version = $vcalendar->getProperty( Kigkonsult\Icalcreator\Util\Util::$VERSION )

##### Set Version

Set property value. Only version 2.0 valid, version is AUTO generated at calendar creation.

Format

vcalendar::setProperty( "version", version )

version = (string) iCal version

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); // initiate new CALENDAR $vcalendar->setProperty( Kigkonsult\Icalcreator\Util\Util::$VERSION, "2.0" );

[index] [top] [up]

#### 3.1.2.7 X-PROPERTY

A calendar, non-standard property with a TEXT value and a name with an "X-" prefix. In a calendar, an x-property, with an unique name, can occur only once but the number of x-properties are unlimited.

X-properties "X-WR-CALNAME", "X-WR-CALDESC" and "X-WR-TIMEZONE" may be required when importing iCal files into some calendaring software (MS etc.), as well as METHOD property (value PUBLISH etc.) and the (automatically created) DTSTAMP and UID properties.

The value type is TEXT.

##### Create X-property

If set, returns [RFC5545] formatted string, otherwise null.

Format

vcalendar::createXprop()

Example

$str = $vcalendar->createXprop();

##### Delete X-PROPERTY

Remove X-PROPERTY from calendar.

Format

vcalendar::deleteProperty( "<X-PROPERTY>" )

Example 1

Delete the x-property named "X-PROPERTY".

$vcalendar->deleteProperty( "X-PROPERTY" );

Example 2

Delete all x-properties.

while( $vcalendar->deleteProperty()) continue;

##### Get X-PROPERTY

If set, returns property (name and) value, bool otherwise false.

Format

vcalendar::getProperty()

vcalendar::getProperty( "<X-PROPERTY>" )

output = array( propertyName1, propertyData2 )

vcalendar::getProperty( false, propOrderNo/false, true )

propOrderNo = (int) specific property value

output = array( propertyName1 , array( "value" => propertyData2 ) , "params" => params3))

propertyName1, propertyData2 and params3 specs below.

Example 1

Read all x-prop values in a loop. Output in detail below.

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); while( $xprop = $vcalendar->getProperty( )) { // $xprop = array( propertyName1, propertyData2 ) .. .

Example 2

If exists, read the X-WR-TIMEZONE x-prop

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); if( $xprop = $vcalendar->getProperty( "X-WR-TIMEZONE" )) { // $xprop = array( "X-WR-TIMEZONE", propertyData2 )

Example 3

Read all x-prop values/parameters in a loop.

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); while( $xprop = $vcalendar->getProperty( false, false, true )) { /* $xprop = array( propertyName1, array( "value" => propertyData2, "params" => params3 )) */ .. .

##### Set X-PROPERTY

Insert property name and value. If an x-prop with the same name already exists, it will be replaced. PropertyNames are always stored upperCase, ex. x-wr-calname => X-WR-CALNAME.

Format

vcalendar::setProperty( propertyName, propertyData [, params ] )

propertyName1 = (string) Any property name with a "X-" prefix propertyData2 = (string) Value type TEXT params3 = (array) ( ["LANGUAGE" => (string) "lang*"] *[, xparams] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5546]

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); // initiate new CALENDAR // 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" );

[index] [top] [up]

### 3.1.3 Vcalendar component object methods

#### 3.1.3.1 deleteComponent

Remove component from the Vcalendar instance.

Bool false is returned if no component exists or at end-of-components invoking the method consecutive.

format 1

Remove component with order number (1st=1, 2nd=2).

vcalendar::deleteComponent( orderNumber )

orderNumber = (int) order number

format 2

Remove component with component type (e.g. "vevent") and order 1 alt. suborder number.

vcalendar::deleteComponent( componentType [, componentSuborderNumber])

componentType = (string) component type componentSuborderNumber = (int) order number

format 3

Remove component with UID. N.B UID is NOT set for ALARM / TIMEZONE components.

vcalendar::deleteComponent( UID )

Example 1

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); $vcalendar->deleteComponent( 1 ); $vcalendar->deleteComponent( Kigkonsult\Icalcreator\Vcalendar::VTODO, 2 ); $vcalendar->deleteComponent( "20070803T194810CEST-0123U3PXiX@kigkonsult.se");

Example 2

Deleting all components, using format 2 without order number.

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); while( $vcalendar->deleteComponent( Kigkonsult\Icalcreator\Vcalendar::VEVENT)) { continue; } $vtodo = $vcalendar->getComponent( Kigkonsult\Icalcreator\Vcalendar::VTODO ); while( $vtodo->deleteComponent( Kigkonsult\Icalcreator\Vcalendar::VALARM)) { continue; }

[index] [top] [up]

#### 3.1.3.2 getComponent

Get (next) component from the Vcalendar instance.

Bool false is returned if no component exists or at end-of-components invoking the method consecutive.

format 1

Get next component, until end-of-components.

vcalendar::getComponent()

Example

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); while( $comp = $vcalendar->getComponent()) { .. . }

format 2

Get specific component with order number (1st=1, 2nd=2).

vcalendar::getComponent( orderNumber )

orderNumber = (int) order number

Example

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); if( $comp = $vcalendar->getComponent( 1 )) { .. . }

format 3

Get (first/next) component with component type (until end-of-components) alt. get specific component with component type and suborder number (1st=1, 2nd=2).

vcalendar::getComponent( componentType [, componentSuborderNumber])

componentType = (string) component type componentSuborderNumber = (int) order number

Example

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); if( $comp = $vcalendar->getComponent( Kigkonsult\Icalcreator\Vcalendar::VTODO, 2 )) { .. . }

format 4

Get (first/next) component with UID as key. (UID is NOT set for ALARM / TIMEZONE components.) May be used when trying to find (base) component and corresponding RECURRENCE-ID components.

vcalendar::getComponent( UID )

Example

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); $uid = "20070803T194810CEST-0123U3PXiX@kigkonsult.se"; if( $comp = $vcalendar->getComponent( $uid )) { .. . }

format 5

Get (first/next) component based on specific property contents:

To ease up usage, property name holders are found in top of the "util" class (src/util.php).

Supported Descriptive Component Properties
  CATEGORIES
  LOCATION
  PRIORITY
  RESOURCES
  STATUS
  SUMMARY
Date and Time Component Properties
  COMPLETED
  DTEND
  DUE
  DTSTART
SupportedRelationship Component Properties
  ATTENDEE *1
  CONTACT
  ORGANIZER *1
  RECURRENCE-ID
  RELATED-TO
  URL
  UID
Change Management Component Properties
  CREATED
  DTSTAMP
  LAST-MODIFIED

*1
  ATTENDEE and ORGANIZER search values must be prefixed by protocol ex. "MAILTO:chair@ical.net".

For the property "SUMMARY" ,if a search value (any case) exists within property value, a hit exists. For the other, non-date, properties an exact (strict case) match is required.

To select components based on property values, use selectComponents (Format 2).

To retrieve specific Vcalendar instance property values, searching ALL components, use getProperty (Format 2).

vcalendar::getComponent( search )

search = (array) ( *[ propertyName => uniqueValue ]), multiple array elements are combined by "OR" propertyName = (string) property name, above propertyData = (string) unique property value (strict case), date format "YYYYMMDD" (if any side is DATE, only dates are used), datetime format "YYYYMMDDTHHMMSS"

Example

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); while( $comp = $vcalendar->getComponent( [ Kigkonsult\Icalcreator\Util\Util::$RESOURCES => "PC" ]) { .. . }

[index] [top] [up]

#### 3.1.3.3 newComponent

Create component (VEVENT / VTODO / VJOURNAL / VFREEBUSY / VTIMEZONE) using a Vcalendar factory-method, returning a reference to the new component.

To ease up usage, constants Kigkonsult\Icalcreator\Vcalendar::VEVENT, Kigkonsult\Icalcreator\Vcalendar::VTODO,, Kigkonsult\Icalcreator\Vcalendar::VJOURNAL, Kigkonsult\Icalcreator\Vcalendar::VFREEBUSY and Kigkonsult\Icalcreator\Vcalendar::VTIMEZONE as used in code snippets is available.

Format

vcalendar::newComponent( componentType )

componentType = (string) component type

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vevent = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VEVENT );

[index] [top] [up]

#### 3.1.3.4 replaceComponent

Replace calendar component in vcalendar based on component property UID (EVENT / VTODO / VJOURNAL / VFREEBUSY). If not found, inserted last in component chain.

In case of multiple components sharing the same UID (ex. a RECURRENCE-ID property altering a recurrence pattern), the first found is replaced and it may lead to unpredictable result, to use with care.

For a VTIMEZONE component, a TZID match is required.

A successfull replace returns bool true otherwise bool false.

Format

vcalendar::replaceComponent( component )

component = (object) component instance

Example

$vcalendar->replaceComponent( $component );

[index] [top] [up]

#### 3.1.3.5 selectComponents

Format 1

Selects EVENT / VTODO / VJOURNAL / VFREEBUSY components from the Vcalendar instance on based on dates (notice date restriction), based on the initial DTSTART property along with the RRULE, RDATE, EXDATE and EXRULE properties in the component and UID-matched component(s) with RECURRENCE-ID.

Requirement:

- The property DTSTART is required. If missing in a VTODO component, DUE is used.
- If not using local date, timezone in property DTSTART etc. MUST be PHP complient.

Limitations:

- The values "SECONDLY" / "MINUTELY" / "HOURLY" in the "FREQ" rule part are NOT supported.
- If using components with properties
  UID in combination with SEQUENCE and RECURRENCE-ID
  (i.e. altering an individual instance within the recurrence set),
  the RECURRENCE-ID parameter "RANGE" ("THISANDPRIOR" / "THISANDFUTURE") is NOT (yet) supported.
- only one reccurrence a day
- a RDATE reccurrence will overwrite any RRULE reccurrence, on an date (Ymd) basis
- no X-CURRENT-DTEND if no DTEND (DUE) is set (below)

Returns an array with components (events) or bool false is returned if no found component(s) exists. Replacing (RECURRENCE-ID) components has (if missing) updated COMMENT, DESCRIPTION and COMMENTs properties.

Added X-properties in recurrent instances of a calendar component:

- "X-CURRENT-DTSTART", TEXT content, "Y-m-d [H:i:s [timezone]]" showing the current start date.
- "X-CURRENT-DTEND" alt. "X-CURRENT-DUE" (opt), TEXT content, "Y-m-d [H:i:s [timezone]]" showing the current end date.
- "X-RECURRENCE", the RRULE/RDATE recurrence pattarn number (not in the recurrence start), also after an RECURRENCE-ID change
- "X-OCCURENCE", contains, where applicable, single multi-day recurrence event day number (formatted as 'day X of Y')

To ease up usage, constants Kigkonsult\Icalcreator\Util\UtilSelect::X_CURRENT_DTSTART, Kigkonsult\Icalcreator\Util\UtilSelect::X_CURRENT_DTEND, Kigkonsult\Icalcreator\Util\UtilSelect::X_CURRENT_DUE, Kigkonsult\Icalcreator\Util\UtilSelect::X_RECURRENCE, Kigkonsult\Icalcreator\Util\UtilSelect::X_OCCURENCE are available.

vcalendar::selectComponents([ startYear, startMonth, startDay [, endYear, endMonth, endDay [, cType [, flat [, any [, split]]]]]])

startYear : (int) start year (4*digit), default current year (object) DateTime, start date* startMonth : (int) start month (1-2*digit), default current month (object) DateTime, end date* startDay : (int) start day (1-2*digit), default current day endYear : (int) end year (4*digit), default startYear endMonth : (int) end month (1-2*digit), default startMonth endDay : (int) end day (1-2*digit), default startDay cType : (mixed) calendar component type(-s), (string/array) ("vevent", "vtodo", "vjournal", "vfreebusy") (bool) false (default) => all flat : (bool) true => output : array[] (ignores split) component where recurrence pattern exists within period false (default) => output : array[Year][Month][Day][] any : (bool) true (default) => select components with recurrence within period false => only components that starts (DTSTART) within period split : (bool) true (default) => one component copy for every day it occurs within the period false => one occurrence of component in output array, start date/recurrence (start) date *When using datetime objects, other start/end arguments are ignored. valid flat any split combinations (defaults in upper case) 1 false true true 2 false true false 3 false false [false] (split set to false if flat=false and any=false) 4 true true [false] (split set to false if flat=true) 5 true false [false] (split set to false if flat=true) If flat is set to false, output array is sorted in 'Y-m-d h-i-s' asc. order.

Example

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); $events_arr = $vcalendar->selectComponents( 2007, 11, 1, 2007, 11, 30, Kigkonsult\Icalcreator\Vcalendar::VEVENT ); // select all events occurring 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( Kigkonsult\Icalcreator\Util\Util::$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( Kigkonsult\Icalcreator\Util\Util::$DTSTART ); $summary = $event->getProperty( Kigkonsult\Icalcreator\Util\Util::$SUMMARY ); $description = $event->getProperty( Kigkonsult\Icalcreator\Util\Util::$DESCRIPTION ); .. .

format 2

Using this format, the Vcalendar method selects components based on specific property value(-s).

Supported Descriptive Component Properties
  CATEGORIES
  LOCATION
  PRIORITY
  RESOURCES
  STATUS
  SUMMARY
Supported Relationship Component Properties
  ATTENDEE *1
  CONTACT
  ORGANIZER *1
  RELATED-TO
  URL
  UID

*1
  ATTENDEE and ORGANIZER search values must be prefixed by (upper case) protocol like "MAILTO:chair@ical.net".

To ease up usage, property name holders are found in top of the "util" class (src/util.php).

For the property SUMMARY, if a search value (any case) exists within property value, a hit is found. For the other properties an exact (strict case) match is required. Multiple search properties may coexist.

To retrieve specific Vcalendar instance property values, searching ALL components, use getProperty (Format 2).

To get components based on property values, use getComponent (Format 5).

vcalendar::selectComponents( searchArray )

Outputs an array of matched (unique) components in UID order.

searchArray : (array) *( propertyName => propertyValue ) propertyName : (string) above (any case) propertyValue : (string) value / (array) ( *[ (string) value] )

Example

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); $searchArray = [ Kigkonsult\Icalcreator\Util\Util::$PRIORITY => [ 1, 2, 3, 4 ]]; $highPrioArr = $vcalendar->selectComponents( $searchArray ); // select all components with PRIORITY set to high (1-4) if( ! empty( $highPrioArr )) { $config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se" ]; $highPrioCal = new Kigkonsult\Icalcreator\Vcalendar( $config ); $highPrioCal->setProperty( "X-WR-CALDESC", "High priority events" ); foreach( $highPrioArr as $highPrioComponent ) { $highPrioCal->setComponent( $highPrioComponent ); } $highPrioCal->returnCalendar(); } exit;

[index] [top] [up]

#### 3.1.3.6 setComponent

Replace or update component in the Vcalendar instance. Also add a calendar component to the Vcalendar instance when calendar component is created with the procedural (non-factory) method, see example VEVENT, format 2.

A successful update returns true.

format 1

Insert last in component chain.

vcalendar::setComponent( component ) addComponent( component ) // alias

component = (object) Vcalendar component instance

addComponent, may be removed in future versions.

format 2

Insert/replace component with order number (1st=1, 2nd=2). If replace and orderNumber is not found, component is inserted last in chain.

vcalendar::setComponent( component, orderNumber )

component = (object) Vcalendar component instance int = (int) order numder

format 3

Replace component with component type and 1st alt. component order number. If orderNumber is not found, component is inserted last in chain.

vcalendar::setComponent( component, componentType [, componentSuborderNo])

component = (object) Vcalendar component instance componentType = (string) component type componentSuborderNo = (int) component Suborder Number

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.

vcalendar::setComponent( component, UID )

component = (object) Vcalendar component instance

Example

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); $vevent = vcalendar->getComponent( 1 ); // fetch first EVENT $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$DTSTART, new DateTime( "2006-12-24 19:30:00" ) ); // update DTSTART property $vcalendar->setComponent( $vevent, 1 ); // replace first component

[index] [top] [up]

### 3.1.4 Vcalendar calendar methods

#### 3.1.4.1 parse and merge

Parse iCal file(-s) or string/array calendar content into a single Vcalendar instance (components, properties and parameters), including multiple vcalendars (within a single ICS file) parse, e.g. Oracle Calendar exports.

As for now, you can use (local) filename as argument and, as long as php.ini directive "allow_url_fopen" is enabled, also remote resources using URLs; protocol "http" ("webcal"). A remote file, URL, must be prefixed by "http://" ("webcal://") and suffixed by a valid filename!

Note, the config Directory, Delimiter, Filename, Dirfile and URL keys are objects for removal in future versions. Indicates all file (external resources) read/write methods will be placed outside iCalcreator. A strong recommendation now is placing iCal file/url content acquire functionality outside iCalcreator, this will also offer better acquire control.

If missing, component property UID is created when parsing. For that reason UNIQUE_ID might need to be set before parsing, Se examples below.

Notice date restriction!

If major parse error occurs (like file access error, invalid calendar file or calendar file without components), bool false is returned.

Minor errors like non-standard line-endings, initial and trailing empty lines as well as files without proper end line(-s) (i.e. missing component end and/or "END:CALENDAR" iCal directives) are managed.

Non-standard iCal properties (except the X-properties) are ignored.

Format

vcalendar::parse( [ textToParse ] )

textToParse = (string) calendarContent ex. result from - file_get_contents( "filename") (array) calendarContent ex. result from - file( "filename", FILE_IGNORE_NEW_LINES )

parse example 1

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "file.ics" ); $vcalendar->parse( $iCalContent );

parse example 2

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "http://www.ical.net/calendars/calendar.ics" ); $vcalendar->parse( $iCalContent );

parse example 3

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $str = [ "BEGIN:VCALENDAR", "PRODID:-//kigkonsult.se//NONSGML kigkonsult.se iCalcreator 2.26.8//", "VERSION:2.0", "BEGIN:VEVENT", "DTSTART:20101224T190000Z", "DTEND:20101224T200000Z", "DTSTAMP:20101020T103827Z", "UID:20101020T113827-1234GkdhFR@test.org", "DESCRIPTION:example", "END:VEVENT", "END:VCALENDAR" ]; $vcalendar->parse( $str );

parse example 4

Subject for removal in future versions.

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $vcalendar->parse( "file.ics" );

merge example

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "file1.ics" ); $vcalendar->parse( $iCalContent ); $iCalContent = file_get_contents( "file2.ics" ); $vcalendar->parse( $iCalContent ); file_put_contents( "icalmerge.ics", $vcalendar->createCalendar(), LOCK_EX );

[index] [top] [up]

#### 3.1.4.2 createCalendar

Generate and return (string) calendar.

Format

vcalendar::createCalendar()

Example

$str = $vcalendar->createCalendar(); echo $str;

[index] [top] [up]

#### 3.1.4.3 returnCalendar

Redirect the Vcalendar instance content to user browser. Filename, addressed to browser, is automatically generated if missing or not set and the filename will look like it is set using

$filename = date( "YmdHis" ).".ics"

The method do not stop PHP script (exit), returns (bool) true on success!

Note, the returnCalendar method is subject for change in future versions.

Format

vcalendar::returnCalendar( [ utf8Encode [, gzip [, cdType ]]] )

utf8Encode = (bool) true: utf8 encoded output, false: (default) no encoding gzip = (bool) true: gzip compressed output Header "Content-Length" only sent when gzip=true false: (default) no compressing cdType = (bool) true: (default) Content-Disposition: attachment false: Content-Disposition: inline

Example 1

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vevent = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VEVENT ); $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$DTSTART, new DateTime( "2007-04-01 19:00:00" ) ); $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$DURATION, new DateInterval( "PT1H" ) ); $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$LOCATION, "Central Plaza" ); $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$SUMMARY, "PHP summit" ); $vcalendar->returnCalendar(); exit;

Example 2

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); $utf8Encode = true; if( isset( $_SERVER["HTTP_ACCEPT_ENCODING"] ) && ( false !== strpos( strtolower( $_SERVER["HTTP_ACCEPT_ENCODING"] ), "gzip" ))) { $gzip = true; } else { $gzip = false; } $vcalendar->returnCalendar( $utf8Encode, $gzip ); exit;

[index] [top] [up]

#### 3.1.4.4 saveCalendar

Save the Vcalendar instance in a file, using preset directory and filename. Filename is automatically generated if missing or not set and the filename will look like it is set using

$filename = date( "YmdHis" ).".ics"

Return bool true on success, on error false.

Note, the saveCalendar method is subject for change in future versions.

Format

vcalendar::saveCalendar()

Example

$vcalendar->setConfig( [ Kigkonsult\Icalcreator\Util\Util::$DIRECTORY => "depot", Kigkonsult\Icalcreator\Util\Util::$FILENAME => "calendar.ics" ]); if( false === $vcalendar->saveCalendar()) { echo "error when saving" }

[index] [top] [up]

#### 3.1.4.5 sort

Format 1

Sort created/parsed calendar components on the following (prioritized) keys:
1 - X-CURRENT-DTSTART - X-CURRENT-DTEND/X-CURRENT-DUE
(if created in Vcalendar method selectComponents)
1 - DTSTART - DTEND alt. DURATION (VEVENT and VFREEBUSY components)
1 - DTSTART - DUE alt. DURATION (VTODO components)
1 - DTSTART (VJOURNAL components)
2 - CREATED / DTSTAMP
3 - UID
A date value, like "DTSTART;VALUE=DATE:20120717", are sorted before a datetime value.
VTIMEZONE component(-s) is always placed first (ordered by TZID). The STANDARD / DAYLIGHT sub-components are sorted (on asc. key DTSTART) when calling createCalendar (or returnCalendar).
ALARM sub-components, if exists, are not sorted.

vcalendar::sort()

Example

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); $vcalendar->sort(); $vcalendar->returnCalendar(); exit;

Format 2

Sort created/parsed calendar components based on specific property values and ascending order. If a property is not set in component, an empty sort key is used (i.e. sorted first).

vcalendar::sort( sortArgument )

sortArgument: (string) "ATTENDEE" * / "CATEGORIES" * / "CONTACT" * / "DTSTAMP" / "LOCATION"" / "ORGANIZER" / "PRIORITY" / "RESOURCES" * / "STATUS" / "SUMMARY" / "URL" / "UID" **.

*) For a property where multiple occurrence may exist (ATTENDEE, CATEGORIES, CONTACT, RESOURCES) lowest (alphabetic) value is used as sort key.

**) For multiple components with the same UID, components with RECURRENCE-ID / SEQUENCE set are sorted first (on asc. values) and components without RECURRENCE-ID last.

To ease up usage, property name holders are found in top of the "util" class (src/util.php).

[index] [top] [up]

#### 3.1.4.6 useCachedCalendar

If a recent version of (non-empty and saved) calendar file exists, an HTTP redirect is sent otherwise bool false is returned.

NOTE, the method no longer stops PHP script (exit), returns bool true on success, false on error!

Note, the useCachedCalendar method is subject for change in future versions.

Format

vcalendar::useCachedCalendar( [ timeout [, cdType ]] )

timeout = (int) default 3600 sec cdType = (bool) true: (default) Content-Disposition: attachment false: Content-Disposition: inline

Example

$vcalendar->setConfig( Kigkonsult\Icalcreator\Util\Util::$DIRECTORY, "depot" ); $vcalendar->setConfig( Kigkonsult\Icalcreator\Util\Util::$FILENAME, "calendar.ics" ); $vcalendar->useCachedCalendar();

[index] [top] [up]

#### 3.1.4.7 iCalcreatorVersion

This static class method returns the iCalcreator class version number.

There is also a PHP constant "ICALCREATOR_VERSION" (all versions).

Format

vcalendar::iCalcreatorVersion()

[index] [top] [up]

### 3.1.5 Vcalendar configuration

#### 3.1.5.1 configuration keys

You will find convenient holders for config keys in top of the "util" class file (src/util.php) as well as some (most) property parameter keys.

key | calendar | component | remark
allowEmpty | * | * |
Compsinfo | * | * | getConfig only
Delimiter1 | * |  |
Directory1 | * |  |
Filename1 | * |  |
Dirfile1 | * |  | getConfig only
Filesize1 | * |  | getConfig only
Language | * | * |
setPropertyNames |  | * | getConfig only
TZID | * | * |
Unique_id | * | * |
URL1 | * |  |

1 objects for removal in future versions.

[index] [top] [up]

#### 3.1.5.2 getConfig

vcalendar::getConfig( [ key ] )

key = (string) config key

Example 1

$uniqueId = $vcalendar->getConfig( Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID );

Example 2

$config = $vcalendar->getConfig();

Output= array( string key => mixed value *[, string key => mixed value] )

[index] [top] [up]

#### 3.1.5.3 calendar/component initialization

Format

Create a new Vcalendar instance.

vcalendar::vcalendar( [ config ] )

config = (array) ( *[, key => value] ) key = (string) config key value = (mixed) config value

Example 1

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config );

Do NOT set directory/filename in vcalendar constructor, due to inability to detect error (bool false) config return.

Create a new calendar component.

vcalendar::component( [ config ] )

config = (array) ( key => value *[, key => value] ) key = (string) config key value = (mixed) config value

Example 2

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se" ]; $vevent = new Kigkonsult\Icalcreator\Vevent( $config );

Example 3

$config = $vcalendar->getConfig(); $vevent = new Kigkonsult\Icalcreator\Vevent( $config );

Only component relevant configuration are set. If using the newComponent method, configuration is set automatically.

[index] [top] [up]

#### 3.1.5.4 setConfig

A successful "setConfig" returns true.

Format 1

vcalendar::setConfig( [ config ] )

config = (array) ( key => value *[, key => value] ) key = (string) config key value = (mixed) config value

Example 1

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar(); $vcalendar->setConfig( $config );

Format 2

vcalendar::setConfig( key, value )

key = (string) config key value = (mixed) config value

Example 1

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar(); $vcalendar->setConfig( Kigkonsult\Icalcreator\Util\Util::$TZID, "UTC" );

Example 2

$vevent = new Kigkonsult\Icalcreator\Vevent(); $vevent->setConfig( Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID, "kigkonsult.se" );

[index] [top] [up]

#### 3.1.5.5 Allow empty components

Allow or reject empty calendar properties. Used in createCalendar, returnCalendar or create<Property> methods, creating [RFC5545] formats.

Default true (allow).

[index] [top] [up]

#### 3.1.5.6 Component information

Only to use with Vcalendar method getConfig.

Get information about the Vcalendar instance components. Returns array with basic information about all components (in array format) within the Vcalendar instance.

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 Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); $compsinfo = $vcalendar->getConfig( Kigkonsult\Icalcreator\Util\Util::$COMPSINFO ); foreach( $compsinfo as compinfo) { echo " order number : " . $compinfo["ordno"]."<br/>"; echo " type : " . $compinfo["type"]."<br/>"; echo " UID : " . $compinfo["uid"]."<br/>"; foreach( $compinfo["props"] as $propertyName => $propertyCount ) { echo " $propertyName = $propertyCount"; if( is_array( $compinfo["sub"] )) { foreach( $compinfo["sub"] as $subcompinfo ) { echo " order number : " . $subcompinfo["ordno"]."<br/>"; /* .. dito if subcomponents exists */ } } // end foreach } // end foreach

[index] [top] [up]

#### 3.1.5.7 Delimiter

Directory/filename delimiter.

Default PHP constant DIRECTORY_SEPARATOR. If used, must be set BEFORE filename!

Note, the delimiter config key is subject for removal in future versions. A strong recommendation is placing iCal file content acquire/dispose functionality outside iCalcreator, this will also offer better acquire/dispose control.

[index] [top] [up]

#### 3.1.5.8 Directory

Local directory to store/read iCal files.

Default ".".

Directory must be set BEFORE filename and must exist and be writeable otherwise bool false is returned. If set using an config array and together with Filename, Directory are set automatically first. When setting directory, the PHP realpath function is applied to speed up parse/saveCalendar methods. When setting Directory, any previously set URL is removed.

Note, the directory config key is subject for removal in future versions. A strong recommendation is placing iCal file content acquire/dispose functionality outside iCalcreator, this will also offer better acquire/dispose control.

Example

$dir = 'test'; $config = [ Kigkonsult\Icalcreator\Util\Util::$DIRECTORY => $dir ]; if( false === $vcalendar->setConfig( $config )) { die( "Invalid directory $dir" ); }

For temporary calendar files, you may set directory/filename using PHP functions sys_get_temp_dir() and tempnam().

Do NOT set directory/filename in vcalendar constructor, due to inability to detect error (bool false) config return.

[index] [top] [up]

#### 3.1.5.9 Dirfile

Only available in Vcalendar method getConfig, returning (string) directory, delimiter and filename.

Note, the dirfile config key is subject for removal in future versions. A strong recommendation is placing iCal file content acquire/dispose functionality outside iCalcreator, this will also offer better acquire/dispose control.

[index] [top] [up]

#### 3.1.5.10 Fileinfo

Only available in Vcalendar method getConfig, giving information in array format about directory, filename and filesize.

Note, the fileinfo config key is subject for removal in future versions. A strong recommendation is placing iCal file content acquire/dispose functionality outside iCalcreator, this will also offer better acquire/dispose control.

Example

$fileinfo = $vcalendar->getConfig( Kigkonsult\Icalcreator\Util\Util::$FILEINFO );

output = array( <directory>, <filename>, <filesize> )

[index] [top] [up]

#### 3.1.5.11 Filename

Calendar local file name, default created like (if not set) like

$filename = date( "YmdHis" ).".ics";

If not set, filename is created when requested, ex. in Vcalendar methods saveCalendar or getConfig(Kigkonsult\Icalcreator\Util\Util::$FILENAME).

Local filename must be set AFTER setting directory (and opt. delimiter)! Filename (and opt. directory) must be readable/writeable otherwise bool false is returned.

Note, the filename config key is subject for removal in future versions. A strong recommendation is placing iCal file content acquire/dispose functionality outside iCalcreator, this will also offer better acquire/dispose control.

Example

$dir = 'test'; $config = [ Kigkonsult\Icalcreator\Util\Util::$DIRECTORY => $dir ]; if( false === $vcalendar->setConfig( $config )) { die( "Error when config directory $dir" ); } $file = 'temp.ics'; $config = [ Kigkonsult\Icalcreator\Util\Util::$FILENAME => $file ]; if( false === $vcalendar->setConfig( $config )) { die( "Error when config filename $file" ); }

For temporary calendar files, you may set directory/filename using PHP functions sys_get_temp_dir() and tempnam().

Do NOT set directory/filename in vcalendar constructor, due to inability to detect error (bool false) config return.

[index] [top] [up]

#### 3.1.5.12 Filesize

Only when getting configuration (using Vcalendar method getConfig).
Returns the size of the file in bytes, to be invoked
- after "saveCalendar()"
or
- after a "setConfig( "directory" / "filename" )" and before/after "parse()".
Getting the filesize for a remote file (URL) will always return zero.

Note, the filesize config key is subject for removal in future versions. A strong recommendation is placing iCal file content acquire/dispose functionality outside iCalcreator, this will also offer better acquire/dispose control.

[index] [top] [up]

#### 3.1.5.13 Language

Language for the Vcalendar instance and component TEXT value properties as defined in [RFC5546].

Default empty.

If NOT set in TEXT property parameters, language from component instance "setConfig( "language", ..)" method will be used, if set, otherwise language from calendar method "setConfig( "language", ..)" will be used, if set.

The calendar property PRODID is always recreated when setting (calendar) language (, note Unique_id, below).

[index] [top] [up]

#### 3.1.5.14 setPropertyNames

Returns array of property names for all set properties in component. "X-PROP" will be used when X-properties are set.

[index] [top] [up]

#### 3.1.5.15 TZID

General timezone, will be used if no TZID parameter is supplied when setting DTSTART, DTEND, DUE or RECURRENCE-ID, a TZID auto completion.

Default empty.

Note, some calendar software may also require calendar property X-WR-TIMEZONE and vtimezone component property X-LIC-LOCATION (to be set manually, examine also the createTimezone a TimezoneHandler class method ).

[index] [top] [up]

#### 3.1.5.16 Unique_id

"Unique_id" is used in calendar property PRODID and component property UID, both created automatically (, if not setting UID manually.

PRODID 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 AUTOMATICALLY generated by using PHP function gethostbyname( $_SERVER["SERVER_NAME"] ) when running in a web server environment or "localhost" when using command line interface. Used when setting other (domain) name than server name.

The calendar property PRODID is always recreated when setting unique_id.

If missing, the component property UID is created at first use of Vcalendar methods createCalendar, returnCalendar or saveCalendar

A strong recommendation is always to set unique_id, creating a new Vcalendar or component instance, to ensure accurate creation of all components UID property, also before parse, in case of missing UID.

[index] [top] [up]

#### 3.1.5.17 URL

When reading remote files or resources with URL (using the parse() method), protocol "http" ("webcal") and "https" are supported.

When setting URL, the previously set Directory is removed.

A remote file is identified by the file suffix ".ics", otherwise the URL is classified as a resource. When setting URL to a remote iCal file, only directory need to be (re-)set, filename remains unchanged (i.e. 1. set URL, 2. parse, 3. set directory, 4. saveCalendar). The URL remote file file part can be retrieved by the vcalendar method
getConfig( "filename" ). When using a resource, filename is unset (note filename, above).

Note, the URL config key as well as (internal) URL-parse and (file) save methods are subjects for removal in future versions. A strong recommendation is placing iCal url content acquire functionality outside iCalcreator, this will also offer better acquire control.

Example

Parse of remote file, then local save in "depot" folder, using original filename

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$URL => "http://www.iCal.net/depot/calendar.ics", ] ); $vcalendar->parse(); $vcalendar->sort(); $vcalendar->setConfig( Kigkonsult\Icalcreator\Util\Util::$DIRECTORY, "depot" ); $vcalendar->saveCalendar();

[index] [top] [up]

## 3.2 Component property methods

All iCalcreator component object property methods for get/set data.
For property format in detail, see RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar).

Notice: for properties and VALUE=DATE-TIME in UTC timezone.

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 timezone.

Due to a limitation in PHP date functions (on 32 bit systems), a date (ex. while setting DTSTART property) before 1970 or after GMT may force a PHP date function to generate an error or set date to "January 1 1970". Timezones need to be PHP complient!

### 3.2.1 deleteProperty

Generic Vcalendar instance delete property method,simplifying removal of calendar properties.
Bool false is returned if no property exists or when end-of-properties at consecutive function calls.

Format

calendarComponent::deleteProperty( [ PropName [, order ] )

propName = (string) case independent, [RFC5545] component property names, unknown/missing propName will be used as X-property. order = (int) if missing 1st/next occurrence, used with multiply (property) occurrences

Example

Remove all COMMENT properties in first event component.

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); $event = $vcalendar->getComponent( Kigkonsult\Icalcreator\Vcalendar::VEVENT ); while( $event->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$COMMENT )) { continue; }

[index] [top] [up]

### 3.2.2 getProperty

Generic iCalcreator component get property method, simplifying fetch of properties.

Bool false is returned if no property exists or when end-of-properties at consecutive function calls.

Using the non-standard directive "GEOLOCATION", iCalcreator returns output supporting
ISO6709 "Standard representation of geographic point location by coordinates",
by combining the LOCATION and GEO property values (only if GEO is set).

Format

calendarComponent::getProperty( PropName [, order [, complete ]] )

propName = (string) case independent, [RFc5545] component property names, unknown/missing propName will be used as X-property. order = (int) if missing/false 1st/next occurrence, otherwise with multiply occurrences (1st=1, 2nd=2) complete - (bool) false (default): output only property value true : output = array("value" => <value> ,"params"=> <parameter array>)

Example

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); while( $vevent = $vcalendar->getComponent( Kigkonsult\Icalcreator\Vcalendar::VEVENT )) { $dtstart = $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$DTSTART ); // one occurrence $description = $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$DESCRIPTION ); // one occurrence while( $comment = $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$COMMENT )) { // MAY occur more than once .. . } }

To get Vcalendar instance property values, use getProperty.

[index] [top] [up]

### 3.2.3 parse

Parse iCal component property text from a string or an array. Each string/array row must be strict RFC5545 formatted, i.e. begin with a property name.

Complete ALARMs, all properties included, in array format and first array row as "BEGIN:VALARM", last as "END:VALARM" as well as TIMEZONE and standard/daylight subcomponents.

If major parse error occurs (like invalid calendar structure or no calendar components), bool false is returned.

Minor errors like non-standard line-endings, initial and trailing empty lines as well as files without proper end line(-s) (i.e. missing component end iCal directives) are managed.

Except the X-properties, non-standard properties are ignored.

Format

calendarComponent::parse( propertyText )

propertyText = (string) [RFC5545] formatted property, (array) [RFC5545] formatted properties, property name must start string / rows(-s)

example

$e = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VEVENT ); $e->parse( "DTSTAMP:19970324T1200Z" ); $e->parse( "SEQUENCE:0" ); $e->parse( "ORGANIZER:MAILTO:jdoe@host1.com" ); $e->parse( [ "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( "DESCRIPTION:Project xyz Review Meeting Minutes\\n " . "Agenda\\n " . "1. Review of project version 1.0 requirements.\\n " . "2. Definition of project processes.\\n " . "3. 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 \\n " . "product marketing.\\n " . "- Project processes were accepted.\\n " . "- Project schedule needs to account for scheduled holidays and employee\\n " . " 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( [ "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, comma escaped");

[index] [top] [up]

### 3.2.4 setProperty

Generic iCalcreator component object set property method, simplifying insert of properties. For properties where multiple occurrences are allowed, last parameter is an index, implementing replaceProperty functionality.

A successful update returns bool true.

To ease up usage, property name holders are found in top of the "util" class (src/util.php).

Format

calendarComponent::setProperty( PropName, Proparg_1 *[, Proparg_n] )

propName = (string) case independent, [RFC5545] component property names, unknown propName will be regarded as (a non-standard) X-property. Proparg_n = (mixed) property content Last property argument is a (optional) property dependent parameters array( *[(string) key => (string) value ] ). A non-standard (, experimental) parameter key MUST be prefixed by "X-".

Example

$vevent = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VEVENT ); $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$DTSTART, new DateTime( "2007-04-01 19:00:00" ) ); $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$DURATION, new DateInterval( "PT3H" ) ); $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$LOCATION, quot;Central Plaza" ); $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$SUMMARY, "PHP summit" );

[index] [top] [up]

### 3.2.5 ACTION

This property defines the action to be invoked when an VALARM is triggered,
"AUDIO" / "DISPLAY" / "EMAIL" / "PROCEDURE". This property is REQUIRED and MUST NOT occur more than once. ("PROCEDURE" is deprecated in [RFC5545].)

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$ACTION as used in code snippets is available.

##### Create ACTION

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createAction()

Example

$str = $component->createAction();

##### Delete ACTION

Remove ACTION from component.

Format

calendarComponent::deleteProperty( "Action" )

Example

$valarm->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$ACTION );

##### Get ACTION

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "Action" )

output = actionValue1

Format 2

calendarComponent::getProperty( "Action", false , true )

output = array( "value" => actionValue1 , "params" => xparams2 )

Example

$action = $valarm->getProperty( Kigkonsult\Icalcreator\Util\Util::$ACTION );

##### Set ACTION

Set property value.

Format

calendarComponent::setProperty( "Action", actionValue [, xparams ] )

actionValue1 = (string) one of "AUDIO" / "DISPLAY" / "EMAIL" / "PROCEDURE" xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"

Example

$valarm->setProperty( Kigkonsult\Icalcreator\Util\Util::$ACTION, "DISPLAY" );

[index] [top] [up]

### 3.2.6 ATTACH

The property provides the capability to associate a document object with a calendar component. The property is is REQUIRED and MUST NOT occur more than once in an "ALARM" ("ACTION" "procedure"), OPTIONAL and MUST NOT occur more than once in an "ALARM" ("ACTION" "audio") and OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL and VALARM ("ACTION" "email") components.

The default value type for ATTACH is URI. The value type can also be set to BINARY to indicate inline binary encoded content (params2).

If using other parameters than the recommended "FMTTYPE" and the mandatory "ENCODING" (="BASE64")and "VALUE" (="BINARY") for an inline binary encoded attachment, please use only characters within the ASCII character set in parameter name and content, to ensure proper line folding when using createCalendar and/or returnCalendar.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$ATTACH as used in code snippets is available.

##### Create ATTACH

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createAttach()

Example

$str = $component->createAttach();

##### Delete ATTACH

Remove ATTACH from component.

Format

calendarComponent::deleteProperty( "ATTACH" )

Example 1

$valarm->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$ATTACH );

Example 2

Delete ATTACH property no 2.

$valarm->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$ATTACH, 2 );

Example 3

Deleting all ATTACH properties.

while( $valarm->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$ATTACH )) { continue; }

##### Get ATTACH

If set, returns property value(-s), otherwise bool false.

Format 1

calendarComponent::getProperty( "Attach" )

output = attachValue1

Format 2

calendarComponent::getProperty( "ATTACH", propOrderNo/false , true )

propOrderNo = (int) specific property value,

output = array( "value" => attachValue1 , "params" => params2 )

Format 3

calendarComponent::getProperty( "Attach", propOrderNo )

propOrderNo = (int) specific property value

Get propOrderNo ATTACH

Example

$attach = $valarm->getProperty( Kigkonsult\Icalcreator\Util\Util::$ATTACH );

##### Set ATTACH

Set property value. Parameters will be ordered as prescribed in [RFC5545].

Format

calendarComponent::setProperty( "attach", attachValue1 [, params [, propOrderNo ]] )

attachValue1 = (string) URI / inline binary encoded content params2 = (array ) ( [ "ENCODING" => "BASE64", "VALUE" => "BINARY" ] [, "FMTTYPE" => contentType ] *[, xparams ] ) contentType = (string) The parameter value MUST be the TEXT for either an IANA registered content type or a non-standard content type. xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc

Example

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$ATTACH, "ftp://domain.com/pub/docs/agenda.doc", [ "FMTTYPE" => "application/binary" ] );

[index] [top] [up]

### 3.2.7 ATTENDEE

The property defines an "Attendee" within a calendar component and is OPTIONAL and MUST NOT occur more than once in a VALARM ("ACTION" "email"), OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL and VFREEBUSY components.

This value type for ATTENDEE is URI, a calendar user address.

You can SORT calendar (components) on (asc) ATTENDEE values.

You can export calendar ATTENDEE values as vCards.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$ATTENDEE as used in code snippets is available.

##### Create ATTENDEE

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createAttendee()

Example

$str = $component->createAttendee();

##### Delete ATTENDEE

Remove ATTENDEE from component.

Format

calendarComponent::deleteProperty( "ATTENDEE" )

Example 1

Delete (single/first) ATTENDEE property

$valarm->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$ATTENDEE );

Example 2

Delete ATTENDEE property no 2.

$valarm->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$ATTENDEE, 2 );

Example 3

Deleting all ATTENDEE properties.

while( $valarm->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$ATTENDEE )) { continue; }

##### Get ATTENDEE

If set, returns property value(-s), otherwise bool false.

Format 1

calendarComponent::getProperty( "Attendee" )

output = attendeeValue1

Format 2

calendarComponent::getProperty( "ATTENDEE", propOrderNo/false , true )

propOrderNo = (int) specific property value

output = array( "value" => attendeeValue1 , "params" => array( params2 ))

Format 3

calendarComponent::getProperty( "ATTENDEE", propOrderNo )

propOrderNo = (int) specific property value

output = attendeeValue1

Example

$attendee = $valarm->getProperty( Kigkonsult\Icalcreator\Util\Util::$ATTENDEE );

##### Set ATTENDEE

Set property value. If exist, default parameter values are removed after input (params2). Property value must be prefixed by protocol (ftp://, http://,mailto:, file:// ref. rfc 1738 ), if missing, "mailto:" is set (indicating an internet mail address). Also MEMBER and DIR parameters must be prefixed by protocol. DELEGATED-TO, DELEGATED-FROM, SENT-BY parameters must use protocol "mailto:", prefixed if missing (indicating an internet mail address).

The CN, ROLE, PARTSTAT, RSVP, CUTYPE, MEMBER, DELEGATED-TO,DELEGATED-FROM, SENT-BY and DIR properties are not accepted (i.e. removed) in a "VFREEBUSY" or "VALARM" "ATTENDEE" property content.

Parameters will be ordered as prescribed in [RFC5545].

Format

calendarComponent::setProperty( "attendee", attendeeValue [, params [, propOrderNo ]] )

attendeeValue1 = (string) 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) / (string) x-name (Experimental type) / iana-token (string) (Other IANA registered type) MEMBER = "MEMBER" => array( *[ (string) "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) / (string) x-name (Experimental role) / (string) 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) / (string) x-name (Experimental status) / (string) iana-token (Other IANA registered status) RSVP = "RSVP" => (string) "TRUE" / "FALSE", Default (reply expectation) DELEGATED-TO = "DELEGATED-TO" => array(*[(string) "single calendar user to specified by the property has delegated participation"]) DELEGATED-FROM = "DELEGATED-FROM" => array( *[ (string) "single calendar user that have delegated their participation to the calendar user specified by the property" ] ) SENT-BY = "SENT-BY" => (string) single calendar user that is acting on behalf of the calendar user specified by the property" LANGUAGE = "LANGUAGE" => (string) "lang*" (applies to the CN parameter value) CN = "CN" => (string) "common name to be associated with the calendar user specified by the property" DIR = "DIR" => (string) "reference to a directory entry associated with the calendar user specified by the property" xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5546]

See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar).

Example

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$ATTENDEE, "attendee1@ical.net" ); $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$ATTENDEE, "attendee2@ical.net", [ "cutype" => "INDIVIDUAL", "member" => [ "member1@ical.net", "member2@ical.net", "member3@ical.net" ], "role" => "CHAIR", "PARTSTAT" => "ACCEPTED", "RSVP" => "TRUE", "DELEgated-to" => [ "part1@ical.net", "part2@ical.net", "part3@ical.net" ], "delegateD-FROM" => [ "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 ] );

[index] [top] [up]

### 3.2.8 CATEGORIES

This property defines the categories for a calendar component and is OPTIONAL and MAY occur more than once in VEVENT, VTODO and VJOURNAL components.

The value type for CATEGORIES is TEXT.

You can SORT calendar (components) on (asc) CATEGORIES values.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$CATEGORIES as used in code snippets is available.

##### Create CATEGORIES

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createCategories()

Example

$str = $component->createCategories();

##### Delete CATEGORIES

Remove CATEGORIES from component.

Format

calendarComponent::deleteProperty( "CATEGORIES" )

Example 1

Delete (single/first) CATEGORIES property

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$CATEGORIES );

Example 2

Delete CATEGORIES property no 2.

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$CATEGORIES, 2 );

Example 3

Deleting all CATEGORIES properties.

while( $vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$CATEGORIES )) { continue; }

##### Get CATEGORIES

If set, returns property value(-s), otherwise bool false.

Format 1

calendarComponent::getProperty( "CATEGORIES" )

output = categoryValue1

Format 2

calendarComponent::getProperty( "CATEGORIES", propOrderNo/false , true )

propOrderNo = (int) specific property value

output = array( "value" => categories1 , "params" => params3 )

Format 3

calendarComponent::getProperty( "CATEGORIES", propOrderNo )

propOrderNo = (int) specific property value

Get propOrderNo CATEGORIES

Example

$categories = $valarm->getProperty( Kigkonsult\Icalcreator\Util\Util::$CATEGORIES );

##### Set CATEGORIES

Set property value.

In spite of the fact that CATEGORIES may contain a (comma separated) list of values, a strong recommendation is to split a CATEGORIES "list" into multiple single CATEGORIES entries.

Parameters will be ordered as prescribed in [RFC5545].

Format

calendarComponent::setProperty( "categories", categories [, params [, propOrderNo ]] )

categories1 = (string) categoryValue / (array) ( *categoryValue ) categoryValue2 = (string) textual categories or subtypes of the calendar component, can be specified as a list of categories separated by the COMMA character params3 = (array) ( ["LANGUAGE" => (string) "<lang*>"] *[, xparams] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5546]

Example

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$CATEGORIES, "project_x" );

[index] [top] [up]

### 3.2.9 CLASS

This property defines the access classification for a calendar component and is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO and VJOURNAL components.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$CLASS as used in code snippets is available.

##### Create CLASS

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createClass()

Example

$str = $component->createClass();

##### Delete CLASS

Remove CLASS from component.

Format

calendarComponent::deleteProperty( "CLASS" )

Example

$vjournal->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$CLASS );

##### Get CLASS

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "CLASS" )

output = classValue1

Format 2

calendarComponent::getProperty( "CLASS", false , true )

output = array "value" => classValue1 , "params" => xparams2 )

Example

$class = $valarm->getProperty( Kigkonsult\Icalcreator\Util\Util::$CLASS );

##### Set CLASS

Set property value.

Format

calendarComponent::setProperty( "class", classvalue [, xparams ] )

classvalue1 = "PUBLIC" / "PRIVATE" / "CONFIDENTIAL" / (string) iana-token / (string) x-name xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"

Example

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$CLASS, "CONFIDENTIAL" );

[index] [top] [up]

### 3.2.10 COMMENT

This property specifies non-processing information intended to provide a comment to the calendar user and is OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL, VFREEBUSY, STANDARD and DAYLIGHT components.

The value type for COMMENT is TEXT.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$COMMENT as used in code snippets is available.

##### Create COMMENT

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createComment()

Example

$str = $component->createComment();

##### Delete COMMENT

Remove COMMENT from component.

Format

calendarComponent::deleteProperty( "COMMENT" )

Example 1

Delete (single/first) COMMENT property

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$COMMENT );

Example 2

Delete COMMENT property no 2.

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$COMMENT, 2 );

Example 3

Deleting all COMMENT properties.

while( $vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$COMMENT )) { continue; }

##### Get COMMENT

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "COMMENT" )

output = commentValue1

Format 2

calendarComponent::getProperty( "COMMENT", propOrderNo/false , true )

propOrderNo = (int) specific property value

output = array( "value" => commentValue1 , "params" => params2 )

Format 3

calendarComponent::getProperty( "COMMENT", propOrderNo )

propOrderNo = (int) specific property value

Get propOrderNo COMMENT

Example

$comment = $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$COMMENT );

##### Set COMMENT

Set property value. Parameters will be ordered as prescribed in [RFC5545].

Format

calendarComponent::setProperty( "comment", commentValue [, params [, propOrderNo ]] )

commentValue1 = (string) Value type Text params2 = (array) ( [ "ALTREP" => (string) "<an alternate text representation, URI>"] [, "LANGUAGE" => (string) "lang*"] *[, xparams ] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5546]

Example

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$COMMENT, "this is a comment" );

[index] [top] [up]

### 3.2.11 COMPLETED

This property defines the date and time that a VTODO was actually completed and is OPTIONAL and MUST NOT occur more than once.

The value type for COMPLETED is UTC timezone DATE-TIME.

For methods and formatting, explore the CREATED property.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$CREATED as used in code snippets is available.

[index] [top] [up]

### 3.2.12 CONTACT

The property is used to represent textual contact information or alternately a reference to textual contact information associated with the calendar component. The property is OPTIONAL and MUST NOT occur more than once in a VFREEBUSY or MAY occur more than once in VEVENT, VTODO and VJOURNAL components.

The value type for CONTACT is TEXT.

You can SORT calendar (components) on (asc) CONTACT values.

You can export calendar CONTACT values as vCards.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$CONTACT as used in code snippets is available.

##### Create CONTACT

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createContact()

Example

$str = $component->createContact();

##### Delete CONTACT

Remove CONTACT from component.

Format

calendarComponent::deleteProperty( "CONTACT" )

Example 1

Delete (single/first) CONTACT property

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$CONTACT );

Example 2

Delete CONTACT property no 2.

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$CONTACT, 2 );

Example 3

Deleting all CONTACT properties.

while( $vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$CONTACT )) { continue; }

##### Get CONTACT

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "CONTACT" )

output = contactValue1

Format 2

calendarComponent::getProperty( "CONTACT", propOrderNo/false , true )

propOrderNo = (int) specific property value

output = array( "value" => contactValue1 , "params" => params2 )

Format 3

calendarComponent::getProperty( "CONTACT", propOrderNo )

propOrderNo = (int) specific property value

Get propOrderNo CONTACT

Example

$contact = $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$CONTACT );

##### Set CONTACT

Set property value. Parameters will be ordered as prescribed in [RFC5545].

Format

calendarComponent::setProperty( "contact", contactValue [, params [, propOrderNo ]] )

contactValue1 = (string) Value type TEXT params2 = (array) ( [ "ALTREP" => (string) "<an alternate text representation, URI>"] [, "LANGUAGE" => (string) "lang*"] *[, xparams] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5546]

Example

$c->setProperty( Kigkonsult\Icalcreator\Util\Util::$CONTACT, "tel 012-34 56 789" )

[index] [top] [up]

### 3.2.13 CREATED

This property specifies the date and time that the calendar information was created by the calendar user agent in the calendar store. Note: This is analogous to the creation date and time for a file in the file system. The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO and VJOURNAL components.

The value type for CREATED is UTC timezone DATE-TIME.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$CREATED as used in code snippets is available.

##### Create CREATED

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createCreated()

Example

$str = $component->createCreated();

##### Delete CREATED

Remove CREATED from component.

Format

calendarComponent::deleteProperty( "CREATED" )

Example

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$CREATED );

##### Get CREATED

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "CREATED" )

output = createdDate1

Format 2

calendarComponent::getProperty( "CREATED", false , true )

output = array( "value" => createdDate1 , "params" => xparams2 )

Example

$created = $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$CREATED );

##### Set CREATED

Set property value. Input date is always a UTC timezone DATE-TIME or, if "offset" parameter is used, converted to a UTC timezone DATE-TIME. Notice, you can use the TimezoneHandler::transformDateTime() method to change a local datetime to UTC datetime.

The current UTC date-time is set if invoked without parameters.

Format

calendarComponent::setProperty( "created", [ createdDate [, xparams ]] )

// Recommended formats createdDate = (object) DateTime class instance, will be set to UTC if not UTC timezone createdDate = (string) date/datetime string* // Supported but are objects for removal in future versions 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 ]] ) // results in a UTC timezone DATE-TIME createdDate = (array) ( "timestamp" => (int) timestamp ) // (arr/str) local date + UTC offset will result in a UTC timezone DATE-TIME offset = (int) (+/-)HHmm[ss] // key prefix "X-" xparams2 = array( *[ (string) key => (string) value ] )
date/datetime string* recommended formats "20110625", "2011-06-25", "2011/06/26" "20110625051015", "20110625 051015" "20110625T051015", "20110625t051015" "2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15" "2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15" trailing characters (digits), if exists, will be interpreted as offset other string formats, acceptable by PHP strtotime function, may (would) work (notice date restriction)

Example 1

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vtodo = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VTODO ); $vtodo->setProperty( Kigkonsult\Icalcreator\Util\Util::$CREATED, new DateTime( '2006-08-11 14:30:35 UTC') ); // 11 august 2006 14.30.35 UTC

Example 2

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$CREATED ); // current UTC date-time is set if invoked without parameters

[index] [top] [up]

### 3.2.14 DESCRIPTION

This property provides a more complete textual description of the calendar component, than that provided by the SUMMARY property (, analogous to a mail BODY). The property is OPTIONAL, MUST NOT occur more than once within VEVENT, VTODO or VALARM (PROCEDURE) but can be specified multiple times within a VJOURNAL calendar component. The property is REQUIRED in VALARM (DISPLAY, EMAIL) component.

The value type for DESCRIPTION is TEXT.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$DESCRIPTION as used in code snippets is available.

##### Create DESCRIPTION

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createDescription()

Example

$str = $component->createDescription();

##### Delete DESCRIPTION

Remove DESCRIPTION from component.

Format

calendarComponent::deleteProperty( "DESCRIPTION" )

Example 1

Delete (single/first) DESCRIPTION property.

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$DESCRIPTION );

Example 2

Delete DESCRIPTION property no 2.

$vjournal->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$DESCRIPTION, 2 );

Example 3

Deleting all DESCRIPTION properties.

while( $vjournal->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$DESCRIPTION )) { continue; }

##### Get DESCRIPTION

If set, returns property value(-s), otherwise bool false.

Format 1

calendarComponent::getProperty( "DESCRIPTION" )

output = descriptionValue1

Format 2

calendarComponent::getProperty( "DESCRIPTION", false , true )

output = array( "value" => descriptionValue1 , "params" => params2 )

Example

$description = $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$DESCRIPTION );

##### Set DESCRIPTION

Set property value.

Parameters will be ordered as prescribed in [RFC5545].

Format

calendarComponent::setProperty( "description", descriptionValue [, params [, propOrderNo ]] )

descriptionValue1 = (string) Value type TEXT params2 = (array) ( [ "ALTREP" => (string) "<an alternate text representation, URI>"] [, "LANGUAGE" => (string) "lang*"] *[, xparams ] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5546]

Example

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$DESCRIPTION, "This is a description" );

[index] [top] [up]

### 3.2.15 DTEND

This property specifies the date and time that a calendar component ends. The property is OPTIONAL and MUST NOT occur more than once in VFREEBUSY and VEVENT. In VEVENT, it only occurs if DURATION NOT occurs.

The default value type for DTEND is DATE-TIME, can be set to a DATE value type.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$DTEND as used in code snippets is available.

The value type of the "DTEND" or "DUE" properties MUST match the value type of "DTSTART" property as defined in [RFC5545])

Notice that an end date without a time is in effect midnight of the day before the date, so for timeless dates, use the date following the event date for it to be correct. For an "all-day event" and using timeless dates, the DTEND is equal DTSTART plus one day, example all-day event (2007-12-01)
DTSTART;VALUE=DATE:20071201
DTEND;VALUE=DATE:20071202.

##### Create DTEND

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createDtend()

Example

$str = $component->createDtend();

##### Delete DTEND

Remove DTEND from component.

Format

calendarComponent::deleteProperty( "DTEND" )

Example

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$DTEND );

##### Get DTEND

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "DTEND" )

output = dtendDate1

Format 2

calendarComponent::getProperty( "DTEND", false , true )

output = array( "value" => dtendDate1 , "params" => params2 )

Example

$dtend = $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$DTEND );

##### Set DTEND

Set property value. If DATE value type is expected, "VALUE" = "DATE" must be set (in params2) otherwise DATE-TIME (default) value type is set.

If no timezone parameter (tz or tzidparam below) is set (i.e.local time) and config TZID is set, date-time values will be set WITH timezone from config. Note, if not using DateTime, use function transformDateTime to change a (local) date value to UTC time zone.

Within the "VFREEBUSY" calendar component, the time MUST be specified in the UTC datetime zone.

Parameters will be ordered as prescribed in [RFC5545].

Format

calendarComponent::setProperty( "dtend", dtendDate [, params2 ] )

// Recommended formats dtendDate = (object) DateTime class instance dtendDate = (string) date/datetime string* // Supported but are objects for removal in future versions dtendDate1 = (array) ( "year" => (int) year , "month" => (int) month , "day" => (int) day [, "hour" => (int) hour , "min" => (int) min , "sec" => (int) sec [, "tz" => tz ]] ) dtendDate = (int) year , (int) month , (int) day [, (int) hour , (int) min , (int) sec [, tz ]] dtendDate = array( (int) year , (int) month , (int) day [, (int) hour , (int) min , (int) sec [, tz ]] ) dtendDate = (array) ( "timestamp" => (int) timestamp [,"tz" => tz]) // timestamp without tz will result in a UTC timezone // timestamp with tz=offset will result in a local DATE-TIME tz = (string) <timezone identifier> / offset // timezone will be used as tzidparam (below), if tzidparam not set offset = (int) (+/-)HHmm[ss] // (arr/str) local date + UTC offset // will result in a UTC timezone params2 = (array) ([ tzidparam/datetimeparam/dateparam ] *[,xparams]) tzidparam = Kigkonsult\Icalcreator\Util\Util::$TZID => (string) <timezone identifier> // output as local date-time with timezone identifier // if tzidparam="GMT"/"UTC" then // output date-time is suffixed by 'Z' datetimeparam = "VALUE" => "DATE-TIME" // default, output as date-time dateparam = "VALUE" => "DATE" // output as DATE, ex. all-day event xparams = (string) key => (string) value // key prefix "X-"
date/datetime string* recommended formats "20110625", "2011-06-25", "2011/06/26" "20110625051015", "20110625 051015" "20110625T051015", "20110625t051015" "2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15" "2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15" trailing characters (digits), if exists, will be interpreted as offset/timezone other string formats, acceptable by PHP strtotime function, may (would) work (notice date restriction)

Example 1

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$DTEND, new DateTime( '2006-08-11 16:30:00' ) ); // 11 august 2006 16.30.00 local date

Example 2

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$DTEND, '20060811', [ Kigkonsult\Icalcreator\Util\Util::$VALUE => Kigkonsult\Icalcreator\Util\Util::$DATE ] ); // end of an all-day event

Example 3

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$DTEND, new DateTime( '2006-08-11 09:30:00', new DateTImeZone( 'Europe/Stockholm' )); // output: DTEND;TZID=Europe/Stockholm:20060811T093000

[index] [top] [up]

### 3.2.16 DTSTAMP

The property indicates the date/time the Vcalendar instance was created and is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO, VJOURNAL and VFREEBUSY components. However, DTSTAMP is AUTOMATICALL§Y GENERATED in iCalcreator when creating a component.

DTSTAMP may be required when importing iCal files into some calendar software
(MS etc.), as well as (calendar) x-properties "X-WR-CALNAME", "X-WR-CALDESC" and
"X-WR-TIMEZONE", METHOD property (value PUBLISH etc.) and the (also auto created) UID property.

The value type for DTSTAMP is UTC timezone DATE-TIME.

For methods and formatting, explore the CREATED property.

You can SORT calendar (components) on (asc) DTSTAMP values.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$DTSTAMP is available.

[index] [top] [up]

### 3.2.17 DTSTART

This property specifies when the calendar component begins. The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO, VJOURNAL and VFREEBUSY components. The property is REQUIRED, but MUST NOT occur more than once in STANDARD and DAYLIGHT components.

The default value type for DTSTART is DATE-TIME, can be set to a DATE value type.

For an "all-day event" and using timeless dates, example (2007-12-01)
DTSTART;VALUE=DATE:20071201
DTEND;VALUE=DATE:20071202. // opt., in effect midnight of the day before the date!!

For methods and formatting, explore the DTEND property.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$DTSTART is available.

[index] [top] [up]

### 3.2.18 DUE

This property defines the date and time when a VTODO is expected to be completed and is OPTIONAL and MUST NOT occur more than once and only if DURATION NOT occurs.

The default value type for DUE is DATE-TIME, can be set to a DATE value type.

The value type of the "DTEND" or "DUE" properties MUST match the value type of "DTSTART" property as defined in [RFC5545])

For methods and formatting, explore the DTEND property.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$DUE is available.

[index] [top] [up]

### 3.2.19 DURATION

The property specifies a positive duration of time.

In a VEVENT
  it is OPTIONAL and MUST NOT occur more than once and MUST NOT occur in pair with DTEND. If one occurs, so MUST NOT the other.
In a VTODO
  it is OPTIONAL and MUST NOT occur more than once and MUST NOT occur in pair with DUE. If one occurs, so MUST NOT the other.
In a VFREEBUSY
  it is OPTIONAL and MUST NOT occur more than once. ([RFC2445])
  it can not appear. ([RFC5545])
In a VALARM
  it is OPTIONAL and MUST NOT occur more than once and MUST occur in pair with TRIGGER. If one occurs, so MUST the other.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$DURATION as used in code snippets is available.

##### Create DURATION

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createDuration()

Example

$str = $component->createDuration();

##### Delete DURATION

Remove DURATION from component.

Format

calendarComponent::deleteProperty( "DURATION" )

Example

$valarm->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$DURATION );

##### Get DURATION

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "DURATION" )

output = duration1

Format 2

calendarComponent::getProperty( "DURATION", false , true )

output = array( "value" => duration1 , "params" => xparams2 )

Example

$duration = $vtodo->getProperty( Kigkonsult\Icalcreator\Util\Util::$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 the added DURATION value (incl. opt. timezone).

##### Set DURATION

Set property value.

Format

calendarComponent::setProperty( "duration", duration [, xparams ] )

// Recommended formats duration = (object) DateInterval class instance duration = (string) dur-value = ["+"] "P" (dur-date/dur-time/dur-week) like "P15DT5H0M20S" 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" // Supported but are objects for removal in future versions 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 ]] xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"

Example 1

One day duration.

$vtodo->setProperty( Kigkonsult\Icalcreator\Util\Util::$DURATION, new DateInterval( "P1D" ) );

Example 2

Four hours duration.

$vtodo->setProperty( Kigkonsult\Icalcreator\Util\Util::$DURATION, "PT4H" );

[index] [top] [up]

### 3.2.20 EXDATE

This property defines the list of date/time exceptions for a recurring calendar component and is OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL components.

The default value type for EXDATE is DATE-TIME, can be set to a DATE value type.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$EXDATE as used in code snippets is available.

##### Create EXDATE

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createExdate()

Example

$str = $component->createExdate();

##### Delete EXDATE

Remove EXDATE from component.

Format

calendarComponent::deleteProperty( "EXDATE" )

Example 1

$vtodo->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$EXDATE );

Example 2

Delete EXDATE property no 2.

$vjournal->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$EXDATE, 2 );

Example 3

Deleting all EXDATE properties.

while( $vjournal->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$EXDATE )) { while( $vjournal->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$EXDATE )) { continue; }

##### Get EXDATE

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "EXDATE" )

output = exdates1 (with date1)

Format 2

calendarComponent::getProperty( "exdate", propOrderNo/false, true )

propOrderNo = (int) specific property value

output = array( "value" => exdates1 (with date1) , "params" => xparams2 )

Example

$exdate = $vtodo->getProperty( Kigkonsult\Icalcreator\Util\Util::$EXDATE );

##### Set EXDATE

Set property value.

The value type for EXDATE should match the DTSTART value type.

If DATE value type is set in params ("VALUE" = "DATE"), all timezone or offset in dates are ignored.
If no "VALUE" value type is set, DATE-TIME (default) value type is set.

If "TZID" is set in params, all timezone or offset in dates are ignored (note timestamp, below) and DATE-TIME value type is set.
If empty params and offset in 1st date, all remaining (non-timestamp) dates are set to UTC.
If no "TZID" is set in params and timezone in 1st date, all remaining dates are within this timezone and param "TZID" is set.
If none of the above rules are applicable, DATE-TIME and local date is set default.

Note, if not using DateTime, use function transformDateTime to change a (local) date value to UTC time zone.

EXDATEs are automatically sorted in ascending order (Y-m-d[-H-i-s]).

In spite of the fact that EXDATE may contain a (comma separated) list of values, a strong recommendation is to split an EXDATE "list" into multiple single EXDATE entries. (But if you do, don't mix timezones, may result in incorrect date values.)

Parameters will be ordered as prescribed in [RFC5545].

Format

calendarComponent::setProperty( "exdate", exdates [, params [, propOrderNo ]] )

exdates1 = (array) ( date *[, date ] ) // Recommended formats date = (object) DateTime class instance date = (string) date/datetime string* // Supported but are objects for removal in future versions date = array( (int) year , (int) month , (int) day [, (int) hour , (int) min , (int) sec [, tz ]] ) date1 = (array) ( "year" => (int) year , "month" => (int) month , "day" => (int) day [, "hour" => (int) hour , "min" => (int) min , "sec" => (int) sec [, "tz" => tz ]] ) date = (array) ( "timestamp" => (int) timestamp [, "tz" => tz]) // timestamp without tz will result in a UTC timezone DATE-TIME tz = (string) <timezone identifier> / offset // timezone will be used as tzidparam (below), if tzidparam not set offset = (int) (+/-)HHmm[ss] // (arr/str) local date + UTC offset will result in a UTC timezone DATE-TIME params2 = (array) ([(datetimeparam/dateparam) / tzidparam] *[,xparams]) // default, output as date-time datetimeparam = Kigkonsult\Icalcreator\Util\Util::$VALUE => Kigkonsult\Icalcreator\Util\Util::$DATE_TIME // output as DATE dateparam = Kigkonsult\Icalcreator\Util\Util::$VALUE => Kigkonsult\Icalcreator\Util\Util::$DATE tzidparam = Kigkonsult\Icalcreator\Util\Util::$TZID => (string) <timezone identifier> // key prefix "X-" xparams = (string) key => (string) value // 1=1st, 2=2nd etc propOrderNo = (int) order number
date/datetime string* recommended formats "20110625", "2011-06-25", "2011/06/26" "20110625051015", "20110625 051015" "20110625T051015", "20110625t051015" "2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15" "2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15" trailing characters (digits), if exists, will be interpreted as offset/timezone other string formats, acceptable by PHP strtotime function, may (would) work (notice date restriction)

Example 1

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$EXDATE, [ new DateTime( '2006-08-11' ) ], [ Kigkonsult\Icalcreator\Util\Util::$VALUE => Kigkonsult\Icalcreator\Util\Util::$DATE ] ); // exclude 2006-08-11 from recurrence pattern;

[index] [top] [up]

### 3.2.21 EXRULE

This property defines a rule or repeating pattern for an exception to a recurrence set and is OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL components.

EXRULE is deprecated in [RFC5545]!

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$EXRULE as used in code snippets is available.

##### Create EXRULE

If set, returns [RFC2445] formatted string, otherwise bool false.

Format

calendarComponent::createExrule()

Example

$str = $component->createExrule();

##### Delete EXRULE

Remove EXRULE from component.

Format

calendarComponent::deleteProperty( "EXRULE" )

Example 1

$vtodo->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$EXRULE );

Example 2

Delete EXRULE property no 2.

$vjournal->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$EXRULE, 2 );

Example 3

Deleting all EXRULE properties.

while( $vjournal->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$EXRULE )) { continue; }

##### Get EXRULE

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "EXRULE" )

output = recur1

Format 2

calendarComponent::getProperty( "exrule", propOrderNo/false, true )

propOrderNo = (int) specific property value

output = array( "value" => recur1 , "params" => xparams2 )

Format 3

calendarComponent::getProperty( "EXRULE", propOrderNo )

propOrderNo = (int) specific property value

Get propOrderNo EXRULE

Example

$exrule = $vtodo->getProperty( Kigkonsult\Icalcreator\Util\Util::$EXRULE );

##### Set EXRULE

Set property value. Note, if not using DateTime, use function transformDateTime to change a (local) date value to UTC time zone.

Parameters, will be ordered as prescribed in [RFC5545].

Format

calendarComponent::setProperty( "exrule", recur [, xparams [, propOrderNo ]] )

See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar).

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 "=>" (string) text ] ) freq = "SECONDLY" / "MINUTELY" / "HOURLY" / "DAILY" / "WEEKLY" / "MONTHLY" / "YEARLY" enddate = date // a DATE value or a UTC timezone DATE-TIME value // Recommended formats date = (object) DateTime class instance, will be set to UTC if not UTC timezone date = (string) date/datetime string* // Supported but are objects for removal in future versions date = (array) ( "year" => (int) year , "month" => (int) month , "day" => (int) day [, "hour" => (int) hour , "min" => (int) min , "sec" => (int) sec ]) date = (array) ( "timestamp" => (int) timestamp ) // results in a UTC timezone DATE-TIME 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 and SATURDAY 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 xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc
date/datetime string* recommended formats "20110625", "2011-06-25", "2011/06/26" "20110625051015", "20110625 051015" "20110625T051015", "20110625t051015" "2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15" "2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15" other string formats, acceptable by PHP strtotime function, may (would) work (notice date restriction)

Example

$vevent->setProperty( "Exrule", [ "FREQ" => "MONTHLY", "UNTIL" => new DateTime( '20060831' ), // DATE, if DATE-TIME, UTC timezone "INTERVAL" => 2, "WKST" => "SU", "BYSECOND" => 2, "BYMINUTE" => [ 2, -4, 6 ], // (*) "BYHOUR" => [ 2, 4, -6 ], // (*) "BYMONTHDAY" => -2, // (*) "BYYEARDAY" => 2, // (*) "BYWEEKNO" => [ 2, -4, 6 ], // (*) "BYMONTH" => 2, // (*) "BYSETPOS" => [ 2, -4, 6 [, // (*) "BYday" => [ // (**) [ -2, "DAY" => "WE" ], [ 3, "DAY" => "TH" ], [ 5, "DAY" => "FR" ], [ "DAY" => "MO" ] ], "X-NAME" => "x-value" ), [ "x-key" => "xparamValue" ] ); $vtodo->setProperty( Kigkonsult\Icalcreator\Util\Util::$EXRULE, [ "FREQ" => "WEEKLY", "COUNT" => 2, "INTERVAL" => 2, "WKST" => "SU", "BYSECOND" => [ -2, 4, 6 ], // (*) "BYMINUTE" => -2, // (*) "BYHOUR" => 2, // (*) "BYMONTHDAY" => [ 2, -4, 6 ], // (*) "BYYEARDAY" => [ -2, 4, 6 ], // (*) "BYWEEKNO" => -2, // (*) "BYMONTH" => [ 2, 4, -6 ], // (*) "BYSETPOS" => -2, // (*) "BYday" => [ 5, "DAY" => "WE" ], // (**) "X-NAME" => "x-value" ], [ "x-key" => "xparamValue" ] ); // (*) single value/array of values // (**) single value array /array of arrays

[index] [top] [up]

### 3.2.22 FREEBUSY

The property defines one or more free or busy time intervals in a VFREEBUSY calendar component.

The value type for FREEBUSY is PERIOD. A PERIOD is DATE-TIME/DATE-TIME or DATE-TIME/duration and in the UTC timezone

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$FREEBUSY as used in code snippets is available.

##### Create FREEBUSY

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createFreebusy()

Example

$str = $component->createfreebusy();

##### Delete FREEBUSY

Remove FREEBUSY from component.

Format

calendarComponent::deleteProperty( "FREEBUSY" )

Example 1

Delete (single/first) FREEBUSY property

$vfreebusy->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$FREEBUSY );

Example 2

Delete FREEBUSY property no 2.

$vfreebusy->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$FREEBUSY, 2 );

Example 3

Deleting all FREEBUSY properties.

while( $vfreebusy->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$FREEBUSY )) { continue; }

##### Get FREEBUSY

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "FREEBUSY" )

output = array( "fbtype" => freebusytype1 , periods ) periods = periods2 with startdate/enddate2 below

Format 3

calendarComponent::getProperty( "FREEBUSY", propOrderNo/false , true )

propOrderNo = (int) specific property value

output = array( "value" => array("fbtype" => freebusytype1 ,periods) , "params" => xparams3 ) periods = periods2 with startdate/enddate2 below

Example

$freebusy = $vfreebusy->getProperty( Kigkonsult\Icalcreator\Util\Util::$FREEBUSY );

##### Set FREEBUSY

Set property value. A FREEBUSY input date is always a UTC timezone DATE-TIME. Set dates within the same timezone, otherwise it may lead to unpredictable result;

Format

calendarComponent::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) ( *[, (array) ( startdate, enddate/duration )] ) // Recommended formats startdate/enddate = (object) DateTime class instance, will be set to UTC if not UTC timezone startdate/enddate = (string) datetime string* // Supported but are objects for removal in future versions // startdate/enddate MUST be an UTC timezone DATE-TIME startdate/enddate = (array) ( (int) year , (int) month , (int) day , (int) hour , (int) min , (int) sec ) startdate/enddate2 = (array) ( "year" => (int) year , "month" => (int) month , "day" => (int) day , "hour" => (int) hour , "min" => (int) min , "sec" => (int) sec ) // also output format startdate/enddate = (array) ( "timestamp" => (int) timestamp ) // results in a UTC timezone DATE-TIME // Recommended formats duration = (object) DateInterval class instance duration = (string) dur-value = ("+")"P"(dur-date/dur-time/dur-week) like "P15DT5H0M20S" 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" // Supported but are objects for removal in future versions 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 ) xparams3 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc
date/datetime string* recommended formats "20110625051015 UTC", "20110625 051015 UTC" "20110625T051015 UTC", "20110625t051015 UTC" "2011-06-25 05:10:15 UTC", "2011-06-25T05:10:15 UTC", "2011-06-25t05:10:15 UTC" "2011/06/25 05:10:15 UTC", "2011/06/25T05:10:15 UTC", "2011/06/25t05:10:15 UTC" other string formats, acceptable by PHP strtotime function, may (would) work (notice date restriction)

Example

See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar).

$fdate1 = new DateTime( '2001-01-01 01:01:01 UTC' ); $fdate2 = new DateTime( '2002-02-02 02:02:02 UTC' ); $fdate3 = new DateTime( '2003-03-03 03:03:03 UTC' ); $fdate4 = "4 April 2005 4:4:4 UTC"; $fdur6 = new DateInterval( "P5DT5H5M5S" ); $fdur7 = new DateInterval( "PT5H" ) $fdur8 = "P2D"; $freebusy->setProperty Kigkonsult\Icalcreator\Util\Util::$FREEBUSY, "FREE", [ [ $fdate1, $fdate2 ], [ $fdate3, $fdur6 ], [ $fdate4, $fdate5 ] ] ); $freebusy->setProperty( Kigkonsult\Icalcreator\Util\Util::$FREEBUSY, "Busy", [ [ $fdate1, $fdate2 ], [ $fdate3, $fdur8 ], [ $fdate4, $fdur7 ], [ $fdate1, $fdate3 ] ] );

[index] [top] [up]

### 3.2.23 GEO

This property specifies information related to the global position for the activity specified by VEVENT and VTODO components and is OPTIONAL and MUST NOT occur more than once.

Value type for latitude and longitude is FLOAT.

Values for latitude and longitude shall be expressed as decimal fractions of degrees. Whole degrees of latitude shall be represented by a two-digit decimal number ranging from 0 through 90. Whole degrees of longitude shall be represented by a decimal number ranging from 0 through 180. When a decimal fraction of a degree is specified, it shall be separated from the whole number of degrees by a decimal point.

The output (float) latitude and longitude values are presented up to six decimals.

Using the non-standard directive "GEOLOCATION" when calling iCalcreator calendar or component getProperty method, iCalcreator returns output supporting
ISO6709 "Standard representation of geographic point location by coordinates"
by combining the LOCATION and GEO property values (only if GEO is set).

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$GEO as used in code snippets is available.

##### Create GEO

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createGeo()

Example

$str = $component->createGeo();

##### Delete GEO

Remove GEO from component.

Format

calendarComponent::deleteProperty( "GEO" )

Example

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$GEO );

##### Get GEO

If set, returns GEO property value (latitude/longitude) as prescribed in [RFC5545], otherwise bool false.

Format 1

calendarComponent::getProperty( "GEO" )

output = array( "latitude" => <latitude> , "longitude" => <longitude>))

Format 2

calendarComponent::getProperty( "GEO", false , true )

output = array( "value" => array ( "latitude" => <latitude> , "longitude" => <longitude>)) , "params" => xparams1 )

Example

$geo = $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$GEO );

##### Set GEO

Set property value.

Format

calendarComponent::setProperty( "geo", latitude, longitude [, xparams ] )

latitude = (float) latitude longitude = (float) longitude xparams1 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"

Example

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$GEO, 11.23456, -23.45678 );

[index] [top] [up]

### 3.2.24 LAST-MODIFIED

The property specifies the date and time that the information associated with the calendar component was last revised in the calendar store. The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO, VJOURNAL and VTIMEZONE components.

The value type for LAST-MODIFIED is UTC timezone DATE-TIME.

For methods and formatting, explore the CREATED property.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$LAST_MODIFIED is available.

[index] [top] [up]

### 3.2.25 LOCATION

The property defines the intended venue for the activity defined by a calendar component. The property is OPTIONAL and MUST NOT occur more than once in VEVENT and VTODO components.

The value type for LOCATION is TEXT.

You can SORT calendar (components) on (asc) LOCATION values.

Using the non-standard directive "GEOLOCATION" when calling iCalcreator calendar or component getProperty method, iCalcreator returns output supporting
ISO6709 "Standard representation of geographic point location by coordinates",
by combining the LOCATION and GEO property values (only if GEO is set).

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$LOCATION as used in code snippets is available.

##### Create LOCATION

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createLocation()

Example

$str = $component->createLocation();

##### Delete LOCATION

Remove LOCATION from component.

Format

calendarComponent::deleteProperty( "LOCATION" )

Example

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$LOCATION );

##### Get LOCATION

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "LOCATION" )

output = location1

Format 2

calendarComponent::getProperty( "LOCATION", false , true )

output = array( "value" => location1 , "params" => param2 )

Example

$location = $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$LOCATION );

##### Set LOCATION

Set property value.

Parameters will be ordered as prescribed in [RFC5545].

Format

calendarComponent::setProperty( "location", location [, param] )

location1 = (string) Value type TEXT params2 = (array) ( [ "ALTREP" => (string) "<an alternate text representation, URI>"] [, "LANGUAGE" => (string) "lang*"] *[, xparams ] ) xparams = (string) key => (string) value // key prefix "X-" lang* = as defined in [RFC5546]

Example

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$LOCATION, "Buckingham Palace" );

[index] [top] [up]

### 3.2.26 ORGANIZER

The property defines the organizer for a calendar component and is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO, VJOURNAL and VFREEBUSY components.

This value type for ORGANIZER is URI, a calendar user address.

You can SORT calendar (components) on (asc) ORGANIZER values.

You can export calendar ORGANIZER values as vCards.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$ORGANIZER as used in code snippets is available.

##### Create ORGANIZER

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createOrganizer()

Example

$str = $component->createOrganizer();

##### Delete ORGANIZER

Remove ORGANIZER from component.

Format

calendarComponent::deleteProperty( "ORGANIZER" )

Example

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$ORGANIZER );

##### Get ORGANIZER

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "ORGANIZER" )

output = organizer1

Format 2

calendarComponent::getProperty( "ORGANIZER", false , true )

output = array( "value" => organizer1 , "params" => params2 )

Example

$organizer = $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$ORGANIZER );

##### Set ORGANIZER

Set property value. Property value must be prefixed by protocol (ftp://, http://,mailto:, file:// ref. rfc 1738), "mailto:" prefixed if missing. Also DIR parameter must be prefixed by protocol. SENT-BY parameter must use protocol "mailto:", prefixed if missing.

Parameters will be ordered as prescribed in [RFC5545].

Format

calendarComponent::setProperty( "organizer", organizer [, params] )

organizer1 = (string) a calendar user address (cal-address), a URI as defined by [RFC 1738] or any other IANA registered form for a URI. params2 = (array) ( [ "LANGUAGE" => (string) "lang*" (applies to the CN parameter value) ] [, "CN" => (string) "common name to be associated with the calendar user specified by the property"] [, "DIR" => (string) "reference to a directory entry associated with the calendar user specified by the property" ] [, "SENT-BY" => (string) (cal-address, above) "single calendar user that is acting on behalf of the calendar user specified by the property" ] *[, xparams ] xparams = (string) key => (string) value // key prefix "X-" lang* = as defined in [RFC5546]

Example

$dir = "ldap://domain.com:6666/o=3DDC%20Comp,c=3DUS??(cn=3DJohn%20Doe)"; $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$ORGANIZER, "ical@domain.com", [ "CN" => "John Doe", "DIR" => $dir, "SENT-BY" => "secretary@domain.com", "X-Key1" => "X-Value1", "X-Key2" => "X-Value2" ] );

[index] [top] [up]

### 3.2.27 PERCENT-COMPLETE

This property is used by an assignee or delegatee of a VTODO to convey the percent completion of a VTODO to the Organizer and is OPTIONAL and MUST NOT occur more than once.

The property value is a positive integer between zero and one hundred. A value of "0" indicates the VTODO has not yet been started. A value of "100" indicates that the VTODO has been completed. Integer values in between indicate the percent partially complete.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$PERCENT_COMPLETE as used in code snippets is available.

##### Create PERCENT-COMPLETE

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createPercentComplete()

Example

$str = $component->createPercentComplete();

##### Delete PERCENT-COMPLETE

Remove PERCENT-COMPLETE from component.

Format

calendarComponent::deleteProperty( "PERCENT-COMPLETE" )

Example

$vtodo->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$PERCENT_COMPLETE )

##### Get PERCENT-COMPLETE

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "PERCENT-COMPLETE" )

output = percent1

Format 2

calendarComponent::getProperty( "PRIORITY", false , true )

output = array( "value" => percent1 , "params" => xparams2 )

Example

$percent = $vtodo->getProperty( Kigkonsult\Icalcreator\Util\Util::$PERCENT_COMPLETE );

##### Set PERCENT-COMPLETE

Set property value.

Format

calendarComponent::setProperty( "Percent-Complete", percent [, xparams ] )

percent1 = (int) Value type INTEGER xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"

Example

$vtodo->setProperty( Kigkonsult\Icalcreator\Util\Util::$PERCENT_COMPLETE, 90 );

[index] [top] [up]

### 3.2.28 PRIORITY

The property defines the relative priority for a calendar component and is OPTIONAL and MUST NOT occur more than once in VEVENT and VTODO components.

The priority is specified as an integer in the range zero to nine.
A value of zero (US-ASCII decimal 48) specifies an undefined priority.
A value of one (US-ASCII decimal 49) is the highest priority.
A value of two (US-ASCII decimal 50) is the second highest priority.
Subsequent numbers specify a decreasing ordinal priority.
A value of nine (US-ASCII decimal 58) is the lowest priority.

You can SORT calendar (components) on (asc) PRIORITY values.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$PRIORITY as used in code snippets is available.

##### Create PRIORITY

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createPriority()

Example

$str = $component->createPriority();

##### Delete PRIORITY

Remove PRIORITY from component.

Format

calendarComponent::deleteProperty( "PRIORITY" )

Example

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$PRIORITY );

##### Get PRIORITY

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "PRIORITY" )

output = priority1

Format 2

calendarComponent::getProperty( "PRIORITY", false , true )

output = array( "value" => priority1 , "params" => xparams2 )

Example

$priority = $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$PRIORITY );

##### Set PRIORITY

Set property value.

Format

calendarComponent::setProperty( "priority", priority [, xparams ] )

priority1 = (int) Value type INTEGER xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"

Example

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$PRIORITY, 3 );

[index] [top] [up]

### 3.2.29 RDATE

This property defines the list of date/times for a recurrence set and is OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL, STANDARD and DAYLIGHT components.

The default value type for RDATE is DATE-TIME, can be set to DATE or PERIOD (params2). In STANDARD and DAYLIGHT components, RDATE MUST be specified as a date-time value type with local time value.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$RDATE as used in code snippets is available.

##### Create RDATE

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createRdate()

Example

$str = $component->createRdate();

##### Delete RDATE

Remove RDATE from component.

Format

calendarComponent::deleteProperty( "RDATE" )

Example 1

Delete (single/first) RDATE property.

$vtodo->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$RDATE );

Example 2

Delete RDATE property no 2.

$vjournal->deleteProperty( "RDATE", 2 );

Example 3

Delete all RDATE properties.

while( $vjournal->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$RDATE )) { continue; }

##### Get RDATE

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "RDATE" )

output = dates1

Format 2

calendarComponent::getProperty( "RDATE", propOrderNo/false , true )

propOrderNo = (int) specific property value

output = array( "value" => dates1 , "params" => params2 )

Format 3

calendarComponent::getProperty( "RDATE", propOrderNo )

propOrderNo = (int) specific property value

Get propOrderNo RDATE

Example

$rdates = $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$RDATE );

##### Set RDATE

Set property value.

The value type for RDATE should match the DTSTART value type.

If DATE value type is set in params ("VALUE" = "DATE"), all timezone or offset in dates are ignored.
If no "VALUE" value type is set, DATE-TIME (default) value type is set.

If "TZID" is set in params, all timezone or offset in dates are ignored (note timestamp, below) and DATE-TIME value type is set.
If empty params and offset in 1st date, all remaining (non-timestamp) dates are set to UTC.
If no "TZID" is set in params and timezone in 1st date, all remaining dates are within this timezone and param "TZID" is set.
If none of the above rules are applicable, DATE-TIME and local date is set default.

Note, if not using DateTime, use function transformDateTime to change a (local) date value to UTC time zone.

RDATEs are automatically sorted in ascending order (Y-m-d[-H-i-s]).

A RDATE may contain a (comma separated) list of date values, BUT, a strong recommendation is to split a RDATE "list" into multiple single RDATE entries. (But if you do, don't mix timezones, may result in incorrect date values.)

Parameters will be ordered as prescribed in [RFC5545].

Format

calendarComponent::setProperty( "rdate", dates [, params [, propOrderNo ]] )

dates1 = (array) ( date2 *[, date2 ] ) date2 = date / (array) ( startdate, enddate/duration ) startdate = date enddate = date // Recommended formats date = (object) DateTime class instance date = (string) date/datetime string* // Supported but are objects for removal in future versions date = (array) ( "year" => (int) year , "month" => (int) month , "day" => (int) day [, "hour" => (int) hour , "min" => (int) min , "sec" => (int) sec [, "tz" => tz ]] ) // output format date = (array) ( (int) year , (int) month , (int) day [, (int) int hour , (int) min , (int) day , tz ] ) date = (array) ( "timestamp" => (int) timestamp [, "tz" => tz ] ) // timestamp without tz will result in a UTC timezone DATE-TIME tz = <timezone identifier> / offset // timezone will be used as tzidparam, if tzidparam not set offset = (int) (+/-)HHmm[ss] // (arr/str) local date + UTC offset // will result in a UTC timezone DATE-TIME // Recommended formats duration = (object) DateInterval class instance duration = (string) dur-value = ("+")"P"(dur-date/dur-time/dur-week) like "P15DT5H0M20S" 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" // Supported but are objects for removal in future versions 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 ); params2 = ([tzidparam ( / datetimeparam / dateparam / periodparam )] *[, xparams ] ) tzidparam = Kigkonsult\Icalcreator\Util\Util::$TZID => (string) <timezone identifier> // output as local DATE-TIME with timezone identifier // if tzidparam="GMT"/"UTC" then // output date-time is suffixed by 'Z' // default, output as DATE-TIME datetimeparam = Kigkonsult\Icalcreator\Util\Util::$VALUE => Kigkonsult\Icalcreator\Util\Util::$DATE_TIME // output as DATE dateparam = Kigkonsult\Icalcreator\Util\Util::$VALUE => Kigkonsult\Icalcreator\Util\Util::$DATE // output as PERIOD (datetime) periodparam = Kigkonsult\Icalcreator\Util\Util::$VALUE => Kigkonsult\Icalcreator\Util\Util::$PERIOD xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc
date/datetime string* recommended formats "20110625", "2011-06-25", "2011/06/26" "20110625051015", "20110625 051015" "20110625T051015", "20110625t051015" "2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15" "2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15" trailing characters (digits), if exists, will be interpreted as offset/timezone other string formats, acceptable by PHP strtotime function, may (would) work (notice date restriction)

Example

See rules in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar).

$rdate1 = new DateTime( "2001-01-01 01:01:01 UTC" ); $rdate2 = new DateTime( "2002-02-02 02:02:02 UTC" ); $rdate3 = "3 March 2003 03.03.03 UTC"; $rdate4 = new DateTime( "2004-04-04 04:04:04 UTC" ); $rdate5 = new DateTime( "2005-10-05 05:05:05 UTC" ); $rdate8 = new DateTime( "2007-07-07" ]; // duration for 5 hours, 5 minutes, 5 seconds $rdur6 = new DateInterval( "PT5H5M5S"; // duration for 6 hours $rdur7 = new DateInterval( "PT6H"; // duration for 8 weeks $rdur8 = "P8W"; $vevent = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VEVENT ); // one recurrence date $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$RDATE, [ $rdate1 ] ); // start- and endDate, PERIOD $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$RDATE, [ $rdate1, $rdate2 ] ); // PERIOD, pairs of start- and endDates $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$RDATE, [ [ $rdate1, $rdate2 ], [ $rdate3, $rdate4 ] ], [ Kigkonsult\Icalcreator\Util\Util::$VALUE => Kigkonsult\Icalcreator\Util\Util::$PERIOD ] ); // PERIOD, startdate-duration $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$RDATE, [ [ $rdate2, $rdur6 ]], [ Kigkonsult\Icalcreator\Util\Util::$VALUE => Kigkonsult\Icalcreator\Util\Util::$PERIOD ] ); // PERIOD, pairs of start-/enddate and startdate-duration $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$RDATE, [ [ $rdate1, $date2 ], [ $rdate3, $rdur7 ] ], [ Kigkonsult\Icalcreator\Util\Util::$VALUE => Kigkonsult\Icalcreator\Util\Util::$PERIOD ] ); // start- and enddate as DATE $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$RDATE, [ [ $rdate5, $date8 ]], [ Kigkonsult\Icalcreator\Util\Util::$VALUE => Kigkonsult\Icalcreator\Util\Util::$DATE ] );

[index] [top] [up]

### 3.2.30 RECURRENCE-ID

This property is used in conjunction with the UID and SEQUENCE property to identify a specific instance of a recurring VEVENT, VTODO or VJOURNAL calendar component and is OPTIONAL and MAY NOT occur more than once.

The property value is the effective value of the DTSTART property of the recurrence instance. The default value type is DATE-TIME, can be set to DATE (params2).

For methods and formatting, explore the DTEND property.

The calendar method SORT with argument UID also use RECURRENCE-ID / SEQUENCE as sort parameters.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$RECURRENCE_ID is available.

[index] [top] [up]

### 3.2.31 RELATED-TO

The property is used to represent a relationship or reference between one calendar component and another and is OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL components.

The property value consists of the persistent, globally unique identifier of another calendar component. This value would be represented in a calendar component by the UID property.

The value type for RELATED-TO is TEXT.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$RELATED_TO as used in code snippets is available.

##### Create RELATED-TO

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createRelatedTo()

Example

$str = $component->createRelatedTo();

##### Delete RELATED-TO

Remove RELATED-TO from component.

Format

calendarComponent::deleteProperty( Kigkonsult\Icalcreator\Util\Util::$RELATED_TO )

Example 1

Delete /single/first) RELATED-TO property

$vtodo->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$RELATED_TO )

Example 2

Delete RELATED-TO property no 2.

$vjournal->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$RELATED_TO, 2 );

Example 3

Deleting all RELATED-TO properties.

while( $vjournal->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$RELATED_TO )) { continue; }

##### Get RELATED-TO

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "RELATED-TO" )

output = relid1

Format 2

calendarComponent::getProperty( "RELATED-TO", propOrderNo/false , true )

propOrderNo = (int) specific property value

output = array( "value" => relid1 , "params" => params2 )

Format 3

calendarComponent::getProperty( "RELATED-TO", propOrderNo )

propOrderNo = (int) specific property value

Get propOrderNo RELATED-TO

Example

$relatedId = $vtodo->getProperty( Kigkonsult\Icalcreator\Util\Util::$RELATED_TO );

##### Set RELATED-TO

Set property value.

Format

calendarComponent::setProperty( "Related-To", relid [, params [, propOrderNo ]] )

relid1 = (string) Value type TEXT. params2 = (array) ( [ reltype ] *[, xparams] ) reltype = "RELTYPE" => ("PARENT" (Default) / "CHILD" / "SIBLING" / (string) iana-token / (string) x-name ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc

Example

$vtodo->setProperty( Kigkonsult\Icalcreator\Util\Util::$RELATED_TO, "19960401-080045-4000F192713@host.com");

[index] [top] [up]

### 3.2.32 REPEAT

This property defines the number of time the ALARM should be repeated, after the initial trigger. If the ALARM triggers more than once, then this property MUST be specified along with the DURATION property.

The value type for REPEAT is INTEGER.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$REPEAT as used in code snippets is available.

##### Create REPEAT

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createRepeat()

Example

$str = $component->createRepeat();

##### Delete REPEAT

Remove REPEAT from component.

Format

calendarComponent::deleteProperty( "REPEAT" )

Example

$valarm->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$REPEAT );

##### Get REPEAT

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "REPEAT" )

output = repeatTimes1

Format 2

calendarComponent::getProperty( "REPEAT", false , true )

output = array( "value" => repeatTimes1 , "params" => xparams2 )

Example

$repeat = $valarm->getProperty( Kigkonsult\Icalcreator\Util\Util::$REPEAT );

##### Set REPEAT

Set property value.

Format

calendarComponent::setProperty( "repeat", repeatTimes [, xparams ] )

repeatTimes1 = (int) Value type INTEGER xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"

Example

$valarm->setProperty( Kigkonsult\Icalcreator\Util\Util::$REPEAT, 2 );

[index] [top] [up]

### 3.2.33 REQUEST-STATUS

This property defines the status code returned for a scheduling request and is OPTIONAL and MAY occur more than once in VEVENT, VTODO, VJOURNAL and VFREEBUSY components.

The value type for REQUEST-STATUS is TEXT and consists of

a short return status component,
  (in output) a PERIOD character separated 3-tuple of integers, ex 3.11
a longer return status description component
optionally a statusspecific data component

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$REQUEST_STATUS as used in code snippets is available.

##### Create REQUEST-STATUS

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createRequestStatus()

Example

$str = $component->createRequestStatus();

##### Delete REQUEST-STATUS

Remove REQUEST-STATUS from component.

Format

calendarComponent::deleteProperty( "REQUEST-STATUS" )

Example 1

Delete (single/first) REQUEST-STATUS property.

$vtodo->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$REQUEST_STATUS );

Example 2

Delete REQUEST-STATUS property no 2.

$vjournal->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$REQUEST_STATUS, 2 );

Example 3

Deleting all REQUEST-STATUS properties.

while( $vjournal->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$REQUEST_STATUS )) { continue; }

##### Get REQUEST-STATUS

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "REQUEST-STATUS" )

output = array( "statcode" => statcode1 , "text" => errtext2 [ , "extdata" => extraData3 ] )

Format 2

calendarComponent::getProperty( "REQUEST-STATUS", propOrderNo/false, true )

propOrderNo = (int) specific property value

output = array( "value" => array( "statcode" => statcode1 , "text" => errtext2 [ , "extdata" => extraData3 ] ) , "params" => params4 )

Format 3

calendarComponent::getProperty( "REQUEST-STATUS", propOrderNo )

propOrderNo = (int) specific property value

Get propOrderNo REQUEST-STATUS

Example

$requestStatus = $vtodo->getProperty( Kigkonsult\Icalcreator\Util\Util::$REQUEST_STATUS );

##### Set REQUEST-STATUS

Set property value.

Format

calendarComponent::setProperty( "Request-Status" , statcode, errtext [,extraData/false [,params [,propOrderNo]]])

statcode1 = (int) Hierarchical, numeric return status code (1*DIGIT "." 1*DIGIT 1*DIGIT) errtext2 = (string) Textual status description extraData3 = (string) Textual exception data. For example, the offending property name and value or complete property line. params4 = (array) ( ["LANGUAGE" => (string) "lang*"] *[, xparams ] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5546]

Example

$vfreebusy->setProperty( Kigkonsult\Icalcreator\Util\Util::$REQUEST_STATUS, 2.00, "Invalid property value", "DTSTART:96-Apr-31" );

[index] [top] [up]

### 3.2.34 RESOURCES

This property defines the equipment or resources anticipated for an activity specified by a calendar entity and is OPTIONAL and MAY occur more than once in VEVENT and VTODO components.

The value type for RESOURCES is TEXT.

You can SORT calendar (components) on (asc) RESOURCES values.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$RESOURCES as used in code snippets is available.

##### Create RESOURCES

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createResources()

Example

$str = $component->createResources();

##### Delete RESOURCES

Remove RESOURCES from component.

Format

calendarComponent::deleteProperty( "RESOURCES" )

Example 1

Delete (single/first) RESOURCES property.

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$RESOURCES );

Example 2

Delete RESOURCES property no 2.

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$RESOURCES, 2 );

Example 3

Delete all RESOURCES properties.

while( $vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$RESOURCES )) { continue; }

##### Get RESOURCES

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "RESOURCES" )

output = resources1

Format 2

calendarComponent::getProperty( "RESOURCES", propOrderNo/false, true )

propOrderNo = (int) specific property value

output = array( "value" => resources1 , "params" => params2 )

Format 3

calendarComponent::getProperty( "RESOURCES", propOrderNo )

propOrderNo = (int) specific property value

Get propOrderNo RESOURCES

Example

$resources = $vtodo->getProperty( Kigkonsult\Icalcreator\Util\Util::$RESOURCES );

##### Set RESOURCES

Set property value.

In spite of the fact that RESOURCES may contain a (comma separated) list of values, a strong recommendation is to split a RESOURCES "list" into multiple single RESOURCES entries.

Parameters will be ordered as prescribed in [RFC5545].

Format

calendarComponent::setProperty( "resources", resources [, params [, propOrderNo ]] )

resources1 = (string) resource / (array) ( *resource ) resource = (string) textual resources or subtypes of the calendar component, can be specified as a list of resources separated by the COMMA character. params2 = (array) ( [ "ALTREP" => (string) "<an alternate text representation, URI>"] [, "LANGUAGE" => (string) "lang*"] *[, xparams] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5546]

Example

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$RESOURCES, "COMPUTER PROJECTOR" );

[index] [top] [up]

### 3.2.35 RRULE

This property defines a rule or repeating pattern for recurring EVENTs, TODOs, STANDARD or DAYLIGHT definitions and is OPTIONAL and MAY occur more than once ([RFC2445]), SHOULD NOT occur more than once ([RFC5545]).

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$RRULE as used in code snippets is available.

##### Create RRULE

If set, returns iCal formatted string, otherwise null.

Format

calendarComponent::createRrule()

Example

$str = $component->createRrule();

##### Delete RRULE

Remove RRULE from component.

Format

calendarComponent::deleteProperty( "RRULE" )

Example 1

Delete (single/first) RRULE property.

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$RRULE );

Example 2

Delete RRULE property no 2.

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$RRULE, 2 );

Example 3

Delete all RRULE properties.

while( $vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$RRULE )) { continue; }

##### Get RRULE

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "RRULE" )

output = recur1

Format 2

calendarComponent::getProperty( "RRULE", propOrderNo/false, true )

propOrderNo = (int) specific property value

output = array( "value" => recur1 , "params" => xparams2 )

Format 3

calendarComponent::getProperty( "RRULE", propOrderNo )

propOrderNo = (int) specific property value

Get propOrderNo RRULE

Example

$rrules = $vtodo->getProperty( Kigkonsult\Icalcreator\Util\Util::$RRULE );

##### Set RRULE

Set property value.

Parameters will be ordered as prescribed in [RFC5545].

Format

calendarComponent::setProperty( "rrule", recur [, xparams [, propOrderNo ]] )

For rules example see Exrule format and in detail in RFC2445 - Internet Calendaring and Scheduling Core Object Specification (iCalendar).

recur1 = see Exrule xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc

[index] [top] [up]

### 3.2.36 SEQUENCE

This property defines the revision sequence number of the calendar component within a sequence of revisions. The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO and VJOURNAL components.

It is monotonically incremented by the ORGANIZER's CUA (Calendar User Agent) each time the ORGANIZER makes a significant revision to the calendar component.
When the ORGANIZER makes changes to one of the following properties, the sequence number MUST be incremented: DTSTART, DTEND, DUE, RDATE, RRULE, EXDATE, EXRULE, STATUS. In addition, changes made by the ORGANIZER to other properties can also force the sequence number to be incremented. The ORGANIZER CUA MUST increment the sequence number when ever it makes changes to properties in the calendar component that the ORGANIZER deems will jeopardize the validity of the participation status of the Attendees. For example, changing the location of a meeting from one locale to another distant locale could effectively impact the participation status of the Attendees.

The value type of SEQUENCE is INTEGER.

The calendar method SORT with argument UID also use RECURRENCE-ID / SEQUENCE as sort parameters.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$SEQUENCE as used in code snippets is available.

##### Create SEQUENCE

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createSequence()

Example

$str = $component->createSequence();

##### Delete SEQUENCE

Remove SEQUENCE from component.

Format

calendarComponent::deleteProperty( "SEQUENCE" )

Example

$vtodo->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$SEQUENCE );

##### Get SEQUENCE

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "SEQUENCE" )

output = sequence1

Format 2

calendarComponent::getProperty( "SEQUENCE", false , true )

output = array( "value" => sequence1 , "params" => xparams2 )

Example

$sequence = $vtodo->getProperty( Kigkonsult\Icalcreator\Util\Util::$SEQUENCE );

##### Set SEQUENCE

Set property value.

Format

calendarComponent::setProperty( "sequence" [, sequence [, xparams ]] )

sequence1 = (int) Value type INTEGER xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"

Example 1

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$SEQUENCE, 2 ); // set sequence number to 2

Example 2

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$SEQUENCE ); // force sequence number to be set to 0 // or, if sequence exists, incremented by 1

[index] [top] [up]

### 3.2.37 STATUS

This property defines the overall status or confirmation for the calendar component. The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO and VJOURNAL components.

You can SORT calendar (components) on (asc) STATUS values.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$STATUS as used in code snippets is available.

##### Create STATUS

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createStatus()

Example

$str = $component->createStatus();

##### Delete STATUS

Remove STATUS from component.

Format

calendarComponent::deleteProperty( "STATUS" )

Example

$vtodo->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$STATUS );

##### Get STATUS

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "STATUS" )

output = status1

Format 2

calendarComponent::getProperty( "STATUS", false , true )

output = array( "value" => status1 , "params" => xparams2 )

Example

$status = $vtodo->getProperty( Kigkonsult\Icalcreator\Util\Util::$STATUS );

##### Set STATUS

Set property value.

Format

calendarComponent::setProperty( "status", status [, xparams ] )

// 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 xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"

Example

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$STATUS, "COMPLETED" );

[index] [top] [up]

### 3.2.38 SUMMARY

This property defines a short ("one line") summary or subject for the calendar component. (In "[RFC5545], Recommended Practices", up to 255 characters) (, analogous to a mail SUBJECT). The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO and VJOURNAL components. The property is REQUIRED and MUST occur once in VALARM (EMAIL) calendar component.

The value type for SUMMARY is TEXT.

You can SORT calendar (components) on (asc) SUMMARY values.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$SUMMARY as used in code snippets is available.

##### Create SUMMARY

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createSummary()

Example

$str = $component->createSummary();

##### Delete SUMMARY

Remove SUMMARY from component.

Format

calendarComponent::deleteProperty( "SUMMARY" )

Example

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$SUMMARY );

##### Get SUMMARY

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "SUMMARY" )

output = summary1

Format 2

calendarComponent::getProperty( "SUMMARY", false , true )

output = array( "value" => summary1 , "params" => params2 )

Example

$summary = $vtodo->getProperty( Kigkonsult\Icalcreator\Util\Util::$SUMMARY );

##### Set SUMMARY

Set property value.

Parameters will be ordered as prescribed in [RFC5545].

Format

calendarComponent::setProperty( "summary", summary [, params ] )

summary1 = (string) Value type TEXT, a short, one line summary about the activity or journal entry. params2 = array( ["ALTREP" => (string) "<an alternate text representation, URI>"] [, "LANGUAGE" => (string) "lang*"] *[, xparams ] ) xparams = (string) key => (string) value // key prefix "X-" lang* = as defined in [RFC5546]

Example

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$SUMMARY, "This is a summary" );

[index] [top] [up]

### 3.2.39 TRANSP

This property defines whether an EVENT is transparent or not to busy time searches and is OPTIONAL and MUST NOT occur more than once.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$TRANSP as used in code snippets is available.

##### Create TRANSP

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createTransp()

Example

$str = $component->createTransp();

##### Delete TRANSP

Remove TRANSP from component.

Format

calendarComponent::deleteProperty( "TRANSP" )

Example

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$TRANSP );

##### Get TRANSP

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "TRANSP" )

output = transp1

Format 2

calendarComponent::getProperty( "TRANSP", false , true )

output = array( "value" => transp1 , "params" => xparams2 )

Example

$transp = $vtodo->getProperty( Kigkonsult\Icalcreator\Util\Util::$TRANSP );

##### Set TRANSP

Set property value.

Format

calendarComponent::setProperty( "transp", transp [, xparams ] )

transp1 = "OPAQUE" / "TRANSPARENT" xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"

Example

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$TRANSP, "TRANSPARENT" );

[index] [top] [up]

### 3.2.40 TRIGGER

This property specifies when an ALARM will trigger and is REQUIRED and MUST NOT occur more than once.

The default value type is DURATION. The value type can be set to a DATE-TIME value type, in which case the value MUST specify an UTC timezone DATE-TIME value.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$TRIGGER as used in code snippets is available.

##### Create TRIGGER

If set, returns [RFC5545] formatted string, otherwise null.

Format

valarm::createTrigger()

Example

$str = $component->createTrigger();

##### Delete TRIGGER

Remove TRIGGER from component.

Format

valarm::deleteProperty( "TRIGGER" )

Example

$valarm->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$TRIGGER );

##### Get TRIGGER

If set, returns property value, otherwise bool false.

Format 1

valarm::getProperty( "TRIGGER" )

output = duration1/date3

Format 2

valarm::getProperty( "TRIGGER", false , true )

output = array( "value" => duration1/date3 ) , "params" => params4 )

Example

$trigger = $valarm->getProperty( Kigkonsult\Icalcreator\Util\Util::$TRIGGER );

##### Set TRIGGER

Set property value.

Note, if not using DateTime, use function transformDateTime to change a (local) date value to UTC time zone.

Format 1

valarm::setProperty( "trigger", duration1 [, params4 ] )

Format 2

valarm::setProperty( "trigger", duration2 [, params4 ] )

Format 3

valarm::setProperty( "trigger", date3 [, params4 ] )

Format 4

Note, subject for removal in future versions.

valarm::setProperty( "trigger", (int) year / null (int) month / null, (int) day / null, [ (int) week / null, [ (int) hour / null, (int) min / null, (int) sec / null, relatedStart, before, [ params4 ]]]]] )

// Recommended formats (opt used with params4, below) duration1 = (object) DateInterval class instance duration1 = (string) dur-value = (["+"]/"-")"P"(dur-date/dur-time/dur-week) like "P1DT2H3M4S" 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" // Supported but are objects for removal in future versions duration2 = (array) ( "week" => (int) week, "relatedStart" => relatedStart, "before" => before ) duration2 = (array) ( "day" => (int) day, "hour" => (int) hour, "min" => (int) min, "sec" => (int) sec, "relatedStart" => relatedStart, "before" => before ) relatedStart = (bool) true : related start (default), false : related end before = (bool) true : before relatedStart (default), false : after relatedStart // Recommended formats date3 = (object) DateTime class instance, will be set to UTC if not UTC timezone date3 = (string) datetime string* // Supported but are objects for removal in future versions date3 = (array) ( "year" => (int) year, // UTC timezone DATE-TIME "month" => (int) month, "day" => (int) day, [, "hour" => (int) hour, "min" => (int) min, "sec" => (int) sec ] ) date3 = (array) ( "timestamp" => (int) timestamp ) // UTC timezone DATE-TIME params4 = (array) ( [[ reltype [, trigRelparam ]] / datetimeparam ] *[, xparams ] ) // default "START" reltyp = "RELATED" => "START" / "END" // default "DURATION" trigRelparam = Kigkonsult\Icalcreator\Util\Util::$VALUE => Kigkonsult\Icalcreator\Util\Util::$DURATION // mandatory if DATE-TIME datetimeparam = Kigkonsult\Icalcreator\Util\Util::$VALUE => Kigkonsult\Icalcreator\Util\Util::$DATE_TIME // key prefix "X-" xparams = (string) key => (string) value
datetime string* recommended formats "20110625 UTC", "2011-06-25 UTC", "2011/06/26 UTC" "20110625051015 UTC", "20110625 051015 UTC" "20110625T051015 UTC", "20110625t051015 UTC" "2011-06-25 05:10:15 UTC", "2011-06-25T05:10:15 UTC", "2011-06-25t05:10:15 UTC" "2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15" other string formats, acceptable by PHP strtotime function, may (would) work (notice date restriction)

Example 1

A fix date duration

$valarm->setProperty( Kigkonsult\Icalcreator\Util\Util::$TRIGGER, new DateTime( '2007-06-05 02:02:03 UTC' ) );

Example 2

A duration, 1 hour 2 min 3 sec, before start (before default)

$dateInterval = new DateInterval( "PT1H2M3S" ); $dateInterval->invert = 1; $valarm->setProperty( Kigkonsult\Icalcreator\Util\Util::$TRIGGER, $dateInterval );

Example 3

A duration, 1 week after end.

$valarm->setProperty( Kigkonsult\Icalcreator\Util\Util::$TRIGGER, "P1W", [ "related" => "END" ] );

Example 4

A duration, 1 hour 2 min 3 sec, before start (before default)

$valarm->setProperty( Kigkonsult\Icalcreator\Util\Util::$TRIGGER, "-PT1H2M3S" );

Example 5

A duration, 1 hour 2 min 3 sec, before start (before default).
Subject for removal in future versions.

$valarm->setProperty( Kigkonsult\Icalcreator\Util\Util::$TRIGGER, null, null, null, null, 1, 2, 3 );

Example 6

A duration, 1 hour 2 min 3 sec, before start (before default).
Subject for removal in future versions.

$valarm->setProperty( Kigkonsult\Icalcreator\Util\Util::$TRIGGER, [ "hour"=>1, "min"=>2, "sec"=>3 ] );

Example 7

A duration, 1 week before start (before default).
Subject for removal in future versions.

$valarm->setProperty( Kigkonsult\Icalcreator\Util\Util::$TRIGGER, null, null, null, 1 );

Example 8

A duration, 1 week after end.
Subject for removal in future versions.

$valarm->setProperty( Kigkonsult\Icalcreator\Util\Util::$TRIGGER, [ "week" => 1, "relatedStart" => false, "before" => false ] );

[index] [top] [up]

### 3.2.41 TZID

This property specifies the text value that uniquely identifies the VTIMEZONE calendar component and is REQUIRED, but MUST NOT occur more than once.

The value type for TZID is TEXT.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$TZID as used in code snippets is available.

##### Create TZID

If set, returns [RFC5545] formatted string, otherwise null.

Format

vtimezone::createTzid()

Example

$str = $component->createTzid();

##### Delete TZID

Remove TZID from component.

Format

vtimezone::deleteProperty( Kigkonsult\Icalcreator\Util\Util::$TZID )

Example

$vtimezone->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$TZID );

##### Get TZID

If set, returns property value, otherwise bool false.

Format 1

vtimezone::getProperty( Kigkonsult\Icalcreator\Util\Util::$TZID )

output = tzid1

Format 2

vtimezone::getProperty( Kigkonsult\Icalcreator\Util\Util::$TZID, false , true )

output = array( "value" => tzid1 , "params" => xparams2 )

Example

$tzid = $vtimezone->getProperty( Kigkonsult\Icalcreator\Util\Util::$TZID );

##### Set TZID

Set property value.

Format

vtimezone::setProperty( "tzid", tzid [, xparams ] )

tzid1 = (string) Value type TEXT xparams2 = (array)( *[ (string) key => (string) value ] ) // key prefix "X-"

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vtimezone = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VTIMEZONE ); $vtimezone->setProperty( Kigkonsult\Icalcreator\Util\Util::$TZID, "US-Eastern" );

[index] [top] [up]

### 3.2.42 TZNAME

This property specifies the customary designation for a STANDARD or DAYLIGHT description and is OPTIONAL and MAY occur more than once.

The value type for TZNAME is TEXT.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$TZNAME as used in code snippets is available.

##### Create TZNAME

If set, returns [RFC5545] formatted string, otherwise null.

Format

vtimezone::createTzname()

Example

$str = $component->createTzname();

##### Delete TZNAME

Remove TZNAME from component.

Format

vtimezone::deleteProperty( "TZNAME" )

Example 1

Delete (single/first) TZNAME property.

$vtimezonestd->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$TZNAME );

Example 2

Delete TZNAME property no 2.

$vtimezonestd->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$TZNAME, 2 );

Example 3

Deleting all TZNAME properties.

while( $vtimezonestd->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$TZNAME )) { continue; }

##### Get TZNAME

If set, returns property value, otherwise bool false.

Format 1

vtimezone::getProperty( "TZNAME" )

output = tzname1

Format 2

vtimezone::getProperty( "TZNAME", propOrderNo/false, true )

propOrderNo = (int) specific property value

output = array( "value" => tzname1 , "params" => params2 )

Format 3

vtimezone::getProperty( "TZNAME", propOrderNo )

propOrderNo = (int) specific property value

Get propOrderNo TZNAME

Example

$tzname = $timezonestandard->getProperty( Kigkonsult\Icalcreator\Util\Util::$TZNAME );

##### Set TZNAME

Set property value.

Format

vtimezone::setProperty( "tzname", tzname [, params [, propOrderNo ]] )

tzname1 = (string) Value type TEXT params2 = (array) ( [ "LANGUAGE" => (string) "lang*" ] *[, xparams ] ) xparams = (string) key => (string) value // key prefix "X-" propOrderNo = (int) order number // 1=1st, 2=2nd etc lang* = as defined in [RFC5546]

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vtimezone = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VTIMEZONE ); $vtimezone->setProperty( Kigkonsult\Icalcreator\Util\Util::$TZID, "US-Eastern" ); $vtimezone->setProperty( Kigkonsult\Icalcreator\Util\Util::$LAST_MODIFIED, "19870101" ); $standard = $vtimezone->newComponent( Kigkonsult\Icalcreator\Vcalendar::STANDARD ); $standard->setProperty( Kigkonsult\Icalcreator\Util\Util::$TZNAME, "EST" );

[index] [top] [up]

### 3.2.43 TZOFFSETFROM

This property specifies the offset which is in use prior to this TIMEZONE observance. The property is REQUIRED, but MUST NOT occur more than once in STANDARD and DAYLIGHT components.

The value type is UTC-OFFSET, "+" / "-" time-hour (2*DIGIT) time-minute (2*DIGIT) [time-second (2*DIGIT)].

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$TZOFFSETFROM as used in code snippets is available.

##### Create TZOFFSETFROM

If set, returns [RFC5545] formatted string, otherwise null.

Format

vtimezone::createTzoffsetfrom()

Example

$str = $component->createTzoffsetfrom();

##### Delete TZOFFSETFROM

Remove TZOFFSETFROM from component.

Format

vtimezone::deleteProperty( "TZOFFSETFROM" )

Example

$vtimezonestd->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$TZOFFSETFROM );

##### Get TZOFFSETFROM

If set, returns property value, otherwise bool false.

Format 1

vtimezone::getProperty( "TZOFFSETFROM" )

output = tzoffsetfrom1

Format 2

vtimezone::getProperty( "TZOFFSETFROM", false , true )

output = array( "value" => tzoffsetfrom1 , "params" => xparams2 )

Example

$tzoffsetfrom = $tzstandard->getProperty( Kigkonsult\Icalcreator\Util\Util::$TZOFFSETFROM );

##### Set TZOFFSETFROM

Set property value.

Format

vtimezone::setProperty( "tzoffsetfrom", tzoffsetfrom [, xparams ] )

tzoffsetfrom1 = (int) (+/-)HHmm[ss] // UTC offset xparams2 = (array) ( *[ /string) key => (string) value ] ) // key prefix "X-"

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vtimezone = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VTIMEZONE ); $vtimezone->setProperty( Kigkonsult\Icalcreator\Util\Util::$TZID, "US-Eastern" ); $vtimezone->setProperty( Kigkonsult\Icalcreator\Util\Util::$LAST_MODIFIED, "19870101" ); $standard = $vtimezone->newComponent( Kigkonsult\Icalcreator\Vcalendar::STANDARD ); $standard->setProperty( Kigkonsult\Icalcreator\Util\Util::$TZNAME, "EST" ); $standard->setProperty( Kigkonsult\Icalcreator\Util\Util::$TZOFFSETFROM, "-0500" );

[index] [top] [up]

### 3.2.44 TZOFFSETTO

This property specifies the offset which is in use in this TIMEZONE observance. The property is REQUIRED, but MUST NOT occur more than once in STANDARD and DAYLIGHT components.

The value type is UTC-OFFSET, "+" / "-" time-hour (2*DIGIT) time-minute (2*DIGIT) [time-second (2*DIGIT)].

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$TZOFFSETTO as used in code snippets is available.

##### Create TZOFFSETTO

If set, returns [RFC5545] formatted string, otherwise null.

Format

vtimezone::createTzoffsetto()

Example

$str = $component->createTzoffsetto();

##### Delete TZOFFSETTO

Remove TZOFFSETTO from component.

Format

vtimezone::deleteProperty( "TZOFFSETTO" )

Example

$daylight->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$TZOFFSETTO );

##### Get TZOFFSETTO

If set, returns property value, otherwise bool false.

Format 1

vtimezone::getProperty( "TZOFFSETTO" )

output = tzoffsetto1

Format 2

vtimezone::getProperty( "TZOFFSETTO", false , true )

output = array( "value" => tzoffsetto1 , "params" => xparams2 )

Example

$tzoffsetto = $tztandard->getProperty( Kigkonsult\Icalcreator\Util\Util::$TZOFFSETTO );

##### Set TZOFFSETTO

Set property value.

Format

vtimezone::setProperty( "tzoffsetto", tzoffsetto [, xparams ] )

tzoffsetto1 = (int) (+/-)HHmm[ss] // UTC offset xparams2 = array( *[ (string) key => (string) value ] ) // key prefix "X-"

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vtimezone = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VTIMEZONE ); $vtimezone->setProperty( Kigkonsult\Icalcreator\Util\Util::$TZID, "US-Eastern" ); $vtimezone->setProperty( Kigkonsult\Icalcreator\Util\Util::$LAST_MODIFIED, "19870101" ); $standard = $vtimezone->newComponent( Kigkonsult\Icalcreator\Vcalendar::STANDARD ); .. . $daylight = $vtimezone->newComponent( Kigkonsult\Icalcreator\Vcalendar::DAYLIGHT ); $daylight->setProperty( Kigkonsult\Icalcreator\Util\Util::$TZOFFSETTO, "1345" );

[index] [top] [up]

### 3.2.45 TZURL

The TZURL provides a means for a VTIMEZONE component to point to a network location that can be used to retrieve an up-to-date version of itself. The property is OPTIONAL and MUST NOT occur more than once.

The value type is URI.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$TZURL as used in code snippets is available.

##### Create TZURL

If set, returns [RFC5545] formatted string, otherwise null.

Format

vtimezone::createTzurl()

Example

$str = $component->createTzurl();

##### Delete TZURL

Remove TZURL from component.

Format

vtimezone::deleteProperty( "TZURL" )

Example

$vtimezone->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$TZURL );

##### Get TZURL

If set, returns property value, otherwise bool false.

.

Format 1

vtimezone::getProperty( "TZURL" )

output = tzurl1

Format 2

vtimezone::getProperty( "TZURL", false , true )

output = array( "value" => tzurl1 , "params" => xparams2 )

Example

$tzurl = $timezonestandard->getProperty( Kigkonsult\Icalcreator\Util\Util::$TZURL );

##### Set TZURL

Set property value.

Format

vtimezone::setProperty( "tzurl", tzurl [, xparams ] )

tzurl1 = (string) Value type URI xparams2 = array( *[ (string) key => (string) value ] ) // key prefix "X-"

Example

$tz = "http://zones.stds_r_us.net/tz/US-Eastern" ); $config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vtimezone = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VTIMEZONE ); $vtimezone->setProperty( Kigkonsult\Icalcreator\Util\Util::$TZID, "US-Eastern" ); $vtimezone->setProperty( Kigkonsult\Icalcreator\Util\Util::$LAST_MODIFIED, "19870101T000000" ); $vtimezone->setProperty( Kigkonsult\Icalcreator\Util\Util::$TZURL, $tz );

[index] [top] [up]

### 3.2.46 UID

The persistent, globally Unique IDentifier for the calendar component. The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO, VJOURNAL and VFREEBUSY components.
However, UID is AUTOMATICALLY generated in iCalcreator and configuration unique_id is used when auto-creating component UID.

UID generated format :

date("Ymd\THisT") . "-" . [microSec][random] . "@" . unique_id

microSec = microseconds, 4 pos
random = 6 characters aA-zZ, 0-9

Example

"20070803T194810CEST-0123U3PXiX@kigkonsult.se"

UID may be required when importing iCal files into some calendar software (MS etc.), as well as (calendar) properties x-properties "X-WR-CALNAME", "X-WR-CALDESC" and "X-WR-TIMEZONE", METHOD (value PUBLISH etc.) and the (also automatically created) DTSTAMP property.

The value type for UID is TEXT.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$UID as used in code snippets is available.

You can SORT calendar (components) on (asc) UID values.

##### Create UID

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createUid()

Example

$str = $component->createUid();

##### Delete UID

If UID is remove from a component, UID will automatically be recreated when Vcalendar output methods like createCalendar, returnCalendar or saveCalendar is executed.

Format

calendarComponent::deleteProperty( "UID" )

Example

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$UID );

##### Get UID

If set, returns property, otherwise bool false.

Format 1

calendarComponent::getProperty( "UID" )

output = uid1

Format 2

calendarComponent::getProperty( "UID", false , true )

output = array( "value" => uid1 , "params" => xparams2 )

Example

$uid = $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$UID );

##### Set UID

Insert property value, overrides any previously set or auto-created UID.

Do NOT use an integer UID or only a component name as UID (ex. "vevent"), this may cause malfunction in Vcalendar method setComponent with index or UID argument.

Format

calendarComponent::setProperty( "uid", uid [, xparams ] )

uid1 = (string) Value type TEXT xparams2 = array( *[ (string) key => (string) value ] ) // key prefix "X-"

Example

$vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$UID, "20070803T194810CEST-0123U3PXiX@kigkonsult.se");

BUT, due to poorly created iCal media files, a numeric UID is accepted in the setProperty( UID ) and parse() methods. Do check for component digit UIDs and remove it (will force a (auto) UID recreation) or (re-)set it manually.

if( ctype_digit( $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$UID ))) { $vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$UID ); }

[index] [top] [up]

### 3.2.47 URL

This property defines a Uniform Resource Locator (URL) associated with the iCalendar object. The property is OPTIONAL and MUST NOT occur more than once in VEVENT, VTODO, VJOURNAL and VFREEBUSY components.

The value type is URI.

You can SORT calendar (components) on (asc) URL values.

To ease up usage, Kigkonsult\Icalcreator\Util\Util::$URL as used in code snippets is available.

##### Create URL

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createUrl()

Example

$str = $component->createUrl();

##### Delete URL

Remove URL from component.

Format

calendarComponent::deleteProperty( "URL" )

Example

$vevent->deleteProperty( Kigkonsult\Icalcreator\Util\Util::$URL );

##### Get URL

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "URL" )

output = url1

Format 2

calendarComponent::getProperty( "URL", false , true )

output = array "value" => url1 , "params" => xparams2 )

Example

$url = $vevent->getProperty( Kigkonsult\Icalcreator\Util\Util::$URL );

##### Set URL

Set property value.

Format

calendarComponent::setProperty( "url", url [, xparams ] )

url1 = (string) Value type URI xparams2 = (array) ( *[ (string) key => (string) value ] ) // key prefix "X-"

Example

$vtodo->setProperty( Kigkonsult\Icalcreator\Util\Util::$URL, "http://www.icaldomain.net" );

[index] [top] [up]

### 3.2.48 X-PROPERTY

A component, non-standard property with a TEXT value and a name with an "X-" prefix. In a component, an x-property, with an unique name, can occur only once but the number of x-properties are unlimited.

The value type is TEXT.

##### Create X-PROPERTY

If set, returns [RFC5545] formatted string, otherwise null.

Format

calendarComponent::createXprop()

Example

$str = $component->createxProp();

##### Delete X-PROPERTY

Remove X-PROPERTY from component.

Format

calendarComponent::deleteProperty( "<X-PROPERTY>" )

Example 1

Deleting x-property named "X-PROPERTY".

$vevent->deleteProperty( "X-PROPERTY" );

Example 2

Deleting all x-properties.

while( $vevent->deleteProperty()) { continue; }

##### Get X-property

If set, returns property value, otherwise bool false.

Format 1

calendarComponent::getProperty( "<X-PROPERTY>" )

output = array( propertyName1 , propertyData2 )

Format 2

calendarComponent::getProperty()

output = array( propertyName1 , propertyData2 )

Format 3

calendarComponent::getProperty( false, propOrderNo/false, true )

propOrderNo = (int) specific property value

output = array( propertyName1 , array ( "value" => propertyData2 ) , "params" => params3))

Format 4

calendarComponent::getProperty( false, propOrderNo )

propOrderNo = (int) specific property value

Get propOrderNo X-property

Example 1

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); if( false !== ( $d = $vcalendar->getProperty( "X-WR-TIMEZONE" ))) { echo $d[1]; // $d = array( "X-WR-TIMEZONE", propertyData2 ) }

Example 2

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); while( $xprop = $vcalendar->getProperty( )) { // $xprop = array( propertyName1, propertyData2 ) .. .

Example 3

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); while( $xprop = $vcalendar->getProperty( "X-ABC-MMSUBJ" )) { // $xprop = array( "X-ABC-MMSUBJ", propertyData2 ) .. . }

Example 4

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); while( $xprop = $vcalendar->getProperty( false, false, true )) { /* $xprop = [ propertyName1, [ "value" => propertyData2 ], "params" => params3 ] */

##### Set X-property

Insert property name and value. If an x-prop with the same name already exists, it will be replaced.

Format

calendarComponent::setProperty( propertyName, propertyData [, params ] )

propertyName1 = (string) Any property name with a "X-" prefix propertyData2 = (string) Value type TEXT params3 = (array) ( ["LANGUAGE" => (string) "lang*"] *[, xparams] ) xparams = (string) key => (string) value // key prefix "X-" lang* = as defined in [RFC5546]

Example

$component->setProperty("X-ABC-MMSUBJ","http://load.noise.org/mysubj.wav");

[index] [top] [up]

## 3.3 iCalcreator Component configuration methods

### 3.3.1 Language

Language for specific calendar component as defined in [RFC5546].
Language set at component level can be overridden by specific component property parameter.
A successful "setConfig" returns bool true.

Kigkonsult\Icalcreator\Util\Util::$LANGUAGE as used in code snippets is available.

##### Get language

Language for calendar (only if language is set at component level).

Format

calendarComponent::getConfig( "language" )

Example

$lang = $vevent->getConfig( Kigkonsult\Icalcreator\Util\Util::$LANGUAGE );

##### Set LANGUAGE

Format

calendarComponent::setConfig( "language", lang )

lang = (string) language

Example

$vevent->setConfig( Kigkonsult\Icalcreator\Util\Util::$LANGUAGE, "en" );

[index] [top] [up]

## 3.4 iCalcreator component object misc. methods

Calendar component subcomponent functions.

#### 3.4.1 deleteComponent

Remove subcomponent from component.

Format

calendarComponent::deleteComponent( orderNumber )

orderNumber = (int) component order Number

Remove component with order number (1st=1, 2nd=2).

calendarComponent::deleteComponent( componentType [, componentSuborderNumber])

componentType = (string) component type componentSuborderNumber = (int) component suborder number

Remove component with component type (ex. "vevent") and order 1 alt. suborder number.

calendarComponent::deleteComponent( UID )

Remove component with UID. N.B UID is NOT set for ALARM / timezone components.

Example 1

Delete first subcomponent.

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); $comp1 = $vcalendar->getComponent(); $comp1->deleteComponent( 1 );

Example 2

Delete all subcomponents.

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); $comp1 = $vcalendar->getComponent(); while( $comp1->deleteComponent( Kigkonsult\Icalcreator\Vcalendar::VALARM ) { continue; }

[index] [top] [up]

#### 3.4.2 getComponent

Get subComponent from component.

Format 1

calendarComponent::getComponent()

Get next component until end-of-components.

Format 2

calendarComponent::getComponent( int orderNumber )

orderNumber = (int) component order number

Get component with order number (1st=1, 2nd=2).

Format 3

calendarComponent::getComponent( string componentType [, int componentSuborderNumber])

componentType = (string) component type componentSuborderNumber = (int) component suborder number

Get (next) component with component type (until end-of-components) alt. component with component type and suborder number (1st=1, 2nd=2..).

Format 4

calendarComponent::getComponent( UID )

Get component with UID. N.B UID is NOT set for ALARM / timezone components.

Example

$vcalendar = new Kigkonsult\Icalcreator\Vcalendar( [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", ] ); $iCalContent = file_get_contents( "calendar.ics" ); $vcalendar->parse( $iCalContent ); $comp1 = $vcalendar->getComponent()); while( $subComp = $comp1->getComponent()) { ...

[index] [top] [up]

#### 3.4.3 newComponent

Create subcomponent (ALARN / VTIMEZONE STANDARD / VTIMEZONE DAYLIGHT) using a component factory-method, returning a reference to the new component.

Format

calendarComponent::newComponent( componentType )

componentType = (string) component type

Example 1

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); $vevent = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VEVENT ); // add some EVENT properties $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$DTSTART, 2006, 12, 24, 19, 30, 00 ); $vevent->setProperty( .. . .. . $valarm = $vevent->newComponent( Kigkonsult\Icalcreator\Vcalendar::VALARM ); $valarm->setProperty( Kigkonsult\Icalcreator\Util\Util::$TRIGGER,

Example 2

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); .. . $vtimezone = $vcalendar->newComponent( Kigkonsult\Icalcreator\Vcalendar::VTIMEZONE ); $vtimezone->setProperty( .. . .. . $standard = $vtimezone->newComponent( Kigkonsult\Icalcreator\Vcalendar::STANDARD ); $standard->setProperty( .. . .. . $daylight = $vtimezone->newComponent( Kigkonsult\Icalcreator\Vcalendar::DAYLIGHT ); $daylight->setProperty( .. .

[index] [top] [up]

#### 3.4.4 setComponent

Add calendar component to the Vcalendar instance or replace/update component in the Vcalendar instance.

Format 1

calendarComponent::setComponent( component ) addSubComponent( component ) // alias

Insert last in component chain.

Format 2

calendarComponent::setComponent( component, int orderNumber )

orderNumber = (int) component order number

Replace component with order number(1st=1, 2nd=2). If orderNumber is not found, component is inserted last in chain.

Format 3

calendarComponent::setComponent( component, componentType [,componentSuborderNumber])

componentType = (string) component type componentSuborderNumber = (int) component suborder number

Replace component with component type and component order number. if orderNumber is not found, component is inserted last in chain.

Example

$config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => "Europe/Stockholm" ]; $vcalendar = new Kigkonsult\Icalcreator\Vcalendar( $config ); // initiate new CALENDAR $vevent = new Kigkonsult\Icalcreator\Vevent(); // add some EVENT properties $vevent->setProperty( Kigkonsult\Icalcreator\Util\Util::$DTSTART, 2006, 12, 24, 19, 30, 00 ); $vevent->setProperty( $valarm = new Kigkonsult\Icalcreator\Valarm(); $valarm->setProperty( Kigkonsult\Icalcreator\Util\Util::$TRIGGER, $vevent->setComponent( $valarm ); $vcalendar->setComponent( $vevent );

[index] [top] [up]

# 4 Timezone, XML, json and vCard support

### 4.1 iCalcreator and timezoneHandler class

The TimezoneHandler class has three utility methods: createTimezone, ms2phpTZ and transformDateTime.

#### 4.1.1 createTimezone

The (static) method, applied on a Vcalendar instance and using a PHP valid (string) timezone, return vtimezone, standard and daylight components, based on PHP DateTimeZone class and the PHP time zone transition dates.

Recommendation is to call the method after editing components (and without (period) from/to arguments, below), it will automatically create timezone components, starting seven month before lowest DTSTART value and end 18 month after the higest.

If no time zone transition exists within date arguments or within the "DTSTART"s span, then the time zone transition with the highest transistion date before "from" date is used as base. If still missing, timezone components are created, using current date.

Note, only when timezone NOT is UTC. For dates with UTC timezone DATE-TIME, read this!

Bool false is returned if not using a PHP valid timezone.

Format

TimezoneHandler::createTimezone( calendar, timezone [, xprops, [, from [, to ]]] )

calendar = (object) Vcalendar instance timezone = (string) valid timezone, acceptable by PHP DateTimeZone xprops = (array) ( *[ x-propName => value ] ), timezone non-standard properties from = (int) timestamp, period start date* from = (int) timestamp, period start date* to = (int) timestamp, period end date* * if empty "from" and "to" arguments, the calendar getProperty method (with "DTSTART" as argument) is used to get the lowest (modified, minus 7 month) and highest (modified, plus 15 month) dates.

Example

$tz = "Europe/Stockholm"; $config = [ Kigkonsult\Icalcreator\Util\Util::$UNIQUE_ID => "kigkonsult.se", Kigkonsult\Icalcreator\Util\Util::$TZID => $tz ]; $c = new Kigkonsult\Icalcreator\Vcalendar( $config ); $c->setProperty( "X-WR-TIMEZONE", $tz ); .. . // insert components or parse an iCal file .. . $xprops = [ "X-LIC-LOCATION" => $tz ]; kigkonsult\iCalcreator\TimezoneHandler::createTimezone( $c, $tz, $xprops );

Output example (when using Vcalendar createCalendar or returnCalendar methods):

BEGIN:VTIMEZONE TZID:Europe/Stockholm X-LIC-LOCATION:Europe/Stockholm BEGIN:STANDARD DTSTART:20111030T003000 TZOFFSETFROM:+0200 TZOFFSETTO:+0100 TZNAME:CET END:STANDARD BEGIN:DAYLIGHT DTSTART:20110327T002000 TZOFFSETFROM:+0100 TZOFFSETTO:+0200 TZNAME:CEST END:DAYLIGHT END:VTIMEZONE

[index] [top] [up]

#### 4.1.2 ms2phpTZ

The (static) ms2phpTZ method manages (a very simple) conversion of a MS timezone to a PHP5 valid (Date-)timezone,
matching (MS) UTC offset and time zone descriptors, based on PHP DateTimeZone class.

If true is returned, the MS timezone argument (below) is converted to a PHP5 time zone, otherwise unaltered.

Format

TimezoneHandler::ms2phpTZ( timezone )

timezone = (string) MS timezone (input), PHP5 timezone (output)

Example

$search = '"(UTC-06:00) Central Time (US & Canada)"'; echo "MS tz:'$search'<br>\n"; if( false !== kigkonsult\iCalcreator\TimezoneHandler::ms2phpTZ( $search )) { echo "PHP tz : '{$search}'<br>\n"; }

[index] [top] [up]

#### 4.1.3 transformDateTime

The (static) transformDateTime method transforms a datetime from a time zone to another. (Requires PHP DateTimeZone acceptable time zones).

Bool false is returned if not using a "strtotime" acceptable datetime string or unacceptable PHP time zones. If true, the dateTime argument (below) is converted to the new time zone, otherwise unaltered.

A DATE input (<year><month><day>) will be expanded to a DATETIME (<year><month><day>000000) before transform.

Note, the transformDateTime method is subject for change in future versions.

Format

TimezoneHandler::transformDateTime( dateTime, timezoneFrom [, timezoneTo [, format ]] )

dateTime = (array) ( "year" => (int) year , "month" => (int) month , "day" => (int) day [, "hour" => (int) hour , "min" => (int) min , "sec" => (int) sec ] ) dateTime = (array) ( (int) year , (int) month , (int) day [, (int) hour , (int) min , (int) sec ] ) dateTime = (array) ( "timestamp" => (int) timestamp ) dateTime = (string) datetime string* // output format timezoneFrom = (string) a PHP (DateTimeZone) valid time zone timezoneTo = (string) a PHP (DateTimeZone) valid time zone, default "UTC" format = (string) output format (any date formatting, default "Ymd\THis")
datetime string* recommended formats "20110625", "2011-06-25", "2011/06/26" "20110625051015", "20110625 051015" "20110625T051015", "20110625t051015" "2011-06-25 05:10:15", "2011-06-25T05:10:15", "2011-06-25t05:10:15" "2011/06/25 05:10:15", "2011/06/25T05:10:15", "2011/06/25t05:10:15" other string formats, acceptable by PHP strtotime function, may (would) work (notice date restriction)

Example

Convert from time zone "Europe/Stockholm" to "UTC"

$d = date( "Y-m-d H:i:s" ); $tzFr = "Europe/Stockholm"; if( false !== kigkonsult\iCalcreator\TimezoneHandler::transformDateTime( $d, $tzFr )) { $event->setProperty( Kigkonsult\Icalcreator\Util\Util::$DTSTART, $d . "Z" ); } else { $event->setProperty( Kigkonsult\Icalcreator\Util\Util::$DTSTART, $d, [ Kigkonsult\Icalcreator\Util\Util::$TZID => $tzFr ] ); }

[index] [top] [up]

### 4.2 Timezone helper functions

Additional functions to use with vtimezone components, placed in the "iCal.tz.inc.php" file.

Before calling the functions getTzOffsetForDate and getTimezonesAsDateArrays, set time zone 'GMT' (using 'date_default_timezone_set')!

#### 4.2.1 getTzOffsetForDate

The getTzOffsetForDate function returns UTC offset information for specific date (timezone) based on output from getTimezonesAsDateArrays function.

Before calling the function, set time zone 'GMT' ('date_default_timezone_set')!

Returns array, time zone data for specific date (timestamp) with keys for

- "offsetHis" (+/-Hi[s])
- "offsetSec"( UTC offset in seconds)
- "tzname" (standard/daylight time zone name)

Format

getTzOffsetForDate( timezonesarray, tzid, timestamp )

timezonesarray = (array) output from getTimezonesAsDateArrays, below tzid = (string) time zone identifier timestamp = (mixed) the date in question (timestamp) or UTC datetime (array) ( "year" => (int) year , "month" => (int) month , "day" => (int) day , "hour" => (int) hour , "min" => (int) min , "sec" => (int) sec )

[index] [top] [up]

#### 4.2.2 getTimezonesAsDateArrays

The function creates time zone transition information, based on vtimezone component contents in a Vcalendar instance, using sub-function expandTimezoneDates.

Before calling the function, set time zone 'GMT' ('date_default_timezone_set')!

Returns an array containing time zone data from Vtimezone Standard/Daylight instances (input to getTzOffsetForDate, above).

Format

getTimezonesAsDateArrays( iCalobj )

iCalobj= (object) Vcalendar instance

[index] [top] [up]

### 4.3 iCalcreator and iCalXML class

The IcalXML class methods converts iCal into XML and parses XML into iCal. XML is defined by [RFC6321], "xCal: The XML Format for iCalendar".

#### 4.3.1 iCal2XML

The (static) iCal2XML method converts an Vcalendar instance to XML.

The iCal2XML method utilizes the SimpleXML extension (and "libxml" PHP extension).

An rfc6321 XML string is returned.

Format

IcalXML::iCal2XML( iCalobj )

iCalobj = (object) Vcalendar instance

[index] [top] [up]

#### 4.3.2 XML2iCal

The two entry methods: XMLstr2iCal and XMLfile2iCal converts XML to iCal, i.e. parses an XML string/file into an Vcalendar instance. The methods are not using the PHP SimpleXML extension.

On success, an Vcalendar instance is returned.

On (XML parse) error, bool false is returned.

Note, the XMLfile2iCal method is subject for removal in future versions. A strong recommendation is placing iCal XML file/url content acquire functionality outside iCalcreator, this will also offer better acquire control.

##### XMLstr2iCal

The (static) method accepts a well-formed (rfc6321) XML string as argument.

Format

IcalXML::XMLstr2iCal( xmlstr [, config] )

xmlstr = (string) rfc6321 XML config = (array) iCalcreator config array (opt)

##### XMLfile2iCal

The (static) method accepts an XML (rfc6321) local file or a remote URI, as argument.

Format

IcalXML::XMLfile2iCal( xmlfile [, config] )

xmlfile = (string) rfc6321 XML file name or resource config = (array) iCalcreator config array (opt)

##### XML2iCal

This (static) method is doing the hard work in XMLstr2iCal/XMLfile2iCal methods.

Format

IcalXML::XML2iCal( xmlstr [, config] )

xmlstr = (string) rfc6321 XML config = (array) iCalcreator config array (opt)

[index] [top] [up]

### 4.4 iCalcreator and json export

You can export iCal (XML) as json using a Vcalendar instance, IcalXML::iCal2XML() (above), simplexml_load_string and json_encode as follows:

$xml = kigkonsult\iCalcreator\IcalXML::iCal2XML( $vcalendar ); $json = json_encode( simplexml_load_string( $xml ));

[index] [top] [up]

### 4.5 iCalcreator and iCalvCard class

The IcalvCard class (static) methods produces simplified vCard output.

#### 4.5.1 iCal2vCard

The (static) method converts a single ATTENDEE, CONTACT or ORGANIZER URI (in email format) into simplified vCard output or saved in vCard file.

If argument directory is set, vCards are saved in (directory/) files, named like <firstName>.<familyName>."ext".

Returns vCard string or true if a valid directory is used as argument (and file write ok) otherwise bool false.

Format

IcalvCard::iCal2vCard( email [ ,version [ ,directory [ ,ext ]]] )

email = (string) ATTENDEE, CONTACT or ORGANIZER URI in email format version = (string) vCard version, default "2.1", opt. "3.0"/"4.0" directory = (string) if and where to save vCards files (write rights required), default bool false ext = (string) vCard file extension, default "vcf"

[index] [top] [up]

#### 4.5.2 iCal2vCards

The (static) method collects and converts all ATTENDEEs, CONTACTs and ORGANIZERs (URI, in email format) into simplified vCard (string) output or saved in vCard files, using iCal2vCard function (above).

The file name formatting and return values are described above in iCal2vCard function.

Format

IcalvCard::iCal2vCards( vcalendar [ ,version [ ,directory [ ,ext ]]] )

vcalendar = (object) Vcalendar instance version = (string) vCard version, default "2.1", opt. "3.0"/"4.0" directory = (string) if and where to save vCards files (write rights required), default bool false ext = (string) vCard file extension, default "vcf"

Return (bool) true if argument directory is not null, otherwise vCard string.

[index] [top] [up]

# 5 COPYRIGHT AND LICENSE

Copyright | (c) 2007-2019 Kjell-Inge Gustafsson, kigkonsult, All rights reserved
Link | http://kigkonsult.se/iCalcreator/index.php
Package | iCalcreator
Version | 2.26.8
License | Subject matter of licence is the software iCalcreator. The above copyright, link, package and version notices, this licence notice and the invariant [rfc5545] PRODID result use as implemented and invoked in iCalcreator shall be included in all copies or substantial portions of the iCalcreator. iCalcreator is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. iCalcreator is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with iCalcreator. If not, see <https://www.gnu.org/licenses/>.

[index] [top] [up]