Class iCalendar

Description

A Class for handling Events on a calendar

Located in /iCalendar.php (line 893)


	
			
Method Summary
 static void HttpDateFormat ()
 static void iCalFooter ()
 static void iCalHeader ()
 static void SqlDateFormat ()
 static void SqlDurationFormat ()
 static void SqlUTCFormat ()
 iCalendar iCalendar ( $args)
 void Add (string $key, string $value, [string $parameters = null])
 void AddComponent (iCalComponent $new_component)
 boolean ApplyFilter (array $filter, mixed $value)
 void BuildFromText ( $icalendar)
 void ClearComponents ([string $type = null])
 array ExtractProperty (array $component, string $type, [ $count = 9999])
 array ExtractSubComponent (array $component, string $type, [int $count = 9999])
 void Get ( $key)
 array GetComponents ([string $type = null], [boolean $normal_match = true])
 string JustThisBitPlease ( $type, [ $count = 1])
 void MaskComponents (array $keep)
 arrayref &ParseSomeLines ( $type)
 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 SetComponents (array $new_component, [string $type = null])
 boolean TestFilter ( $filters, array $filter)
Methods
static HttpDateFormat (line 1412)

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.

static void HttpDateFormat ()
static iCalFooter (line 1664)

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.
static void iCalFooter ()
static iCalHeader (line 1647)

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.
static void iCalHeader ()
static SqlDateFormat (line 1420)

Returns a PostgreSQL Date Format string suitable for returning iCal dates

static void SqlDateFormat ()
static SqlDurationFormat (line 1438)

Returns a PostgreSQL Date Format string suitable for returning iCal durations

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

static void SqlDurationFormat ()
static SqlUTCFormat (line 1429)

Returns a PostgreSQL Date Format string suitable for returning dates which

have been cast to UTC

static void SqlUTCFormat ()
Constructor iCalendar (line 935)

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 1341)

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
AddComponent (line 1394)

Adds a new subcomponent

void AddComponent (iCalComponent $new_component)
  • iCalComponent $new_component: The new component to append to the set
ApplyFilter (line 1549)

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 1195)

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
ClearComponents (line 1373)

Clear all components, or the components matching a particular type

void ClearComponents ([string $type = null])
  • string $type: The type of component - omit for all components
DealWithTimeZones (line 1249)

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 1071)

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 1519)

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 1485)

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 1302)

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

void Get ( $key)
  • $key
GetComponents (line 1364)

Get all sub-components, or at least get those matching a type, or failling to match, should the second parameter be set to false.

  • return: an array of the sub-components
array GetComponents ([string $type = null], [boolean $normal_match = true])
  • string $type: The type to match (default: All)
  • boolean $normal_match: Set to false to invert the match (default: true)
JustThisBitPlease (line 1090)

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
MaskComponents (line 1403)

Mask components, removing any that are not of the types in the list

void MaskComponents (array $keep)
  • array $keep: An array of component types to be kept
ParseSomeLines (line 1124)

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
Render (line 1677)

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 1451)

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 1232)

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 1007)

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

void SaveTimeZones ()
Set (line 1321)

Set the value of a property

void Set ( $key,  $value)
  • $key
  • $value
SetComponents (line 1384)

Sets some or all sub-components of the component to the supplied new components

void SetComponents (array $new_component, [string $type = null])
  • string $type: The type of components to be replaced. Defaults to null, which means all components will be replaced.
  • array $new_component: of iCalComponent $new_components The new components to replace the existing ones
TestFilter (line 1623)

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 Tue, 23 Feb 2010 23:10:07 +1300 by phpDocumentor 1.3.2