Class iCalendar

Description

A Class for handling Events on a calendar

Located in /iCalendar.php (line 877)


	
			
Method Summary
 iCalendar iCalendar ( $args)
 void Add (string $key, string $value, [string $parameters = null])
 boolean ApplyFilter (array $filter, mixed $value)
 void BuildFromText ( $icalendar)
 array ExtractProperty (array $component, string $type, [ $count = 9999])
 array ExtractSubComponent (array $component, string $type, [int $count = 9999])
 void Get ( $key)
 void HttpDateFormat ()
 void iCalFooter ()
 void iCalHeader ()
 string JustThisBitPlease ( $type, [ $count = 1])
 arrayref &ParseSomeLines ( $type)
 void Put ( $key,  $value)
 void Render ([boolean $as_calendar = true], [string $type = null], [array $restrict_properties = null])
 void RFC2445ContentEscape (string $name, string $value)
 string RFC2445ContentUnescape (string $escaped)
 void SaveTimeZones ()
 void Set ( $key,  $value)
 void SqlDateFormat ()
 void SqlUTCFormat ()
 boolean TestFilter ( $filters, array $filter)
Methods
Constructor iCalendar (line 919)

The constructor takes an array of args. If there is an element called 'icalendar' then that will be parsed into the iCalendar object. Otherwise the array elements are converted into properties of the iCalendar object directly.

iCalendar iCalendar ( $args)
  • $args
Add (line 1325)

Add a new property/value, regardless of whether it exists already

void Add (string $key, string $value, [string $parameters = null])
  • string $key: The property key
  • string $value: The property value
  • string $parameters: Any parameters to set for the property, as an array of key/value pairs
ApplyFilter (line 1491)

Applies the filter conditions, possibly recursively, to the value which will be either a single property, or an array of lines of the component under test.

  • return: Whether the filter passed / failed.
  • todo: Eventually we need to handle all of these possibilities, which will mean writing several routines:
    • Get Property from Component
    • Get Parameter from Property
    • Test TimeRange
    For the moment we will leave these, until there is a perceived need.
boolean ApplyFilter (array $filter, mixed $value)
  • array $filter: An array of XMLElement defining the filter(s)
  • mixed $value: Either a string which is the single property, or an array of lines, for the component.
BuildFromText (line 1179)

Build the iCalendar object from a text string which is a single iCalendar resource

  • var: The RFC2445 iCalendar resource to be parsed
  • deprecated: This function is deprecated and will be removed eventually.
  • todo: Remove this function.
void BuildFromText ( $icalendar)
  • $icalendar
DealWithTimeZones (line 1233)

Do what must be done with time zones from on file. Attempt to turn them into something that PostgreSQL can understand...

  • deprecated: This function is deprecated and will be removed eventually.
  • todo: Remove this function.
void DealWithTimeZones ()
DefaultPropertyList (line 1055)

An array of property names that we should always want when rendering an iCalendar

  • deprecated: This function is deprecated and will be removed eventually.
  • todo: Remove this function.
void DefaultPropertyList ()
ExtractProperty (line 1461)

Extract a particular property from the provided component. In doing so we assume that the content was unescaped when iCalComponent::ParseFrom() called iCalComponent::UnwrapComponent().

  • return: An array of iCalProperty objects
array ExtractProperty (array $component, string $type, [ $count = 9999])
  • array $component: An array of lines of this component
  • string $type: The type of parameter
  • $count
ExtractSubComponent (line 1427)

Return all sub-components of the given type, which are part of the component we pass in as an array of lines.

  • return: The sub-component lines
array ExtractSubComponent (array $component, string $type, [int $count = 9999])
  • array $component: The component to be parsed
  • string $type: The type of sub-components to be extracted
  • int $count: The number of sub-components to extract (default: 9999)
Get (line 1286)

Get the value of a property in the first non-VTIMEZONE

void Get ( $key)
  • $key
HttpDateFormat (line 1354)

Returns a PostgreSQL Date Format string suitable for returning HTTP (RFC2068) dates Preferred is "Sun, 06 Nov 1994 08:49:37 GMT" so we do that.

void HttpDateFormat ()
iCalFooter (line 1606)

Returns the footer we always use at the finish of our iCalendar resources

  • deprecated: This function is deprecated and will be removed eventually.
  • todo: Remove this function.
void iCalFooter ()
iCalHeader (line 1589)

Returns the header we always use at the start of our iCalendar resources

  • deprecated: This function is deprecated and will be removed eventually.
  • todo: Remove this function.
void iCalHeader ()
JustThisBitPlease (line 1074)

A function to extract the contents of a BEGIN:SOMETHING to END:SOMETHING (perhaps multiply) and return just that bit (or, of course, those bits :-)

  • var: The type of thing(s) we want returned.
  • return: A string from BEGIN:SOMETHING to END:SOMETHING, possibly multiple of these
  • deprecated: This function is deprecated and will be removed eventually.
  • todo: Remove this function.
string JustThisBitPlease ( $type, [ $count = 1])
  • $type
  • $count
ParseSomeLines (line 1108)

Function to parse lines from BEGIN:SOMETHING to END:SOMETHING into a nested array structure

  • var: The "SOMETHING" from the BEGIN:SOMETHING line we just met
  • return: An array of the things we found between (excluding) the BEGIN & END, some of which might be sub-arrays
  • deprecated: This function is deprecated and will be removed eventually.
  • todo: Remove this function.
arrayref &ParseSomeLines ( $type)
  • $type
Put (line 1345)

Because I screwed up with the name originally...

void Put ( $key,  $value)
  • $key
  • $value
Render (line 1619)

Render the iCalendar object as a text string which is a single VEVENT (or other)

void Render ([boolean $as_calendar = true], [string $type = null], [array $restrict_properties = null])
  • boolean $as_calendar: Whether or not to wrap the event in a VCALENDAR
  • string $type: The type of iCalendar object (VEVENT, VTODO, VFREEBUSY etc.)
  • array $restrict_properties: The names of the properties we want in our rendered result.
RFC2445ContentEscape (line 1393)

Returns a suitably escaped RFC2445 content string.

  • deprecated: This function is deprecated and will be removed eventually.
  • todo: Remove this function.
void RFC2445ContentEscape (string $name, string $value)
  • string $name: The incoming name[;param] prefixing the string.
  • string $value: The incoming string to be escaped.
RFC2445ContentUnescape (line 1216)

Returns a content string with the RFC2445 escaping removed

  • return: The string with RFC2445 content escaping removed.
  • deprecated: This function is deprecated and will be removed eventually.
  • todo: Remove this function.
string RFC2445ContentUnescape (string $escaped)
  • string $escaped: The incoming string to be escaped.
SaveTimeZones (line 991)

Save any timezones by TZID in the PostgreSQL database for future re-use.

void SaveTimeZones ()
Set (line 1305)

Set the value of a property

void Set ( $key,  $value)
  • $key
  • $value
SqlDateFormat (line 1362)

Returns a PostgreSQL Date Format string suitable for returning iCal dates

void SqlDateFormat ()
SqlDurationFormat (line 1380)

Returns a PostgreSQL Date Format string suitable for returning iCal durations

  • this doesn't work for negative intervals, but events should not have such!

void SqlDurationFormat ()
SqlUTCFormat (line 1371)

Returns a PostgreSQL Date Format string suitable for returning dates which

have been cast to UTC

void SqlUTCFormat ()
TestFilter (line 1565)

Test a PROP-FILTER or COMP-FILTER and return a true/false COMP-FILTER (is-defined | is-not-defined | (time-range?, prop-filter*, comp-filter*)) PROP-FILTER (is-defined | is-not-defined | ((time-range | text-match)?, param-filter*))

  • return: Whether or not this iCalendar passes the test
boolean TestFilter ( $filters, array $filter)
  • array $filter: An array of XMLElement defining the filter
  • $filters

Documentation generated on Fri, 10 Apr 2009 21:35:08 +1200 by phpDocumentor 1.3.2