Overview

Packages

  • awl
    • AuthPlugin
    • AwlDatabase
    • Browser
    • classEditor
    • DataEntry
    • DataUpdate
    • EMail
    • iCalendar
    • MenuSet
    • PgQuery
    • Session
    • Translation
    • User
    • Utilities
    • Validation
    • vCalendar
    • vComponent
    • XMLDocument
    • XMLElement
  • None

Classes

  • iCalComponent
  • iCalendar
  • iCalProp
  • Overview
  • Package
  • Class

Class iCalComponent

A Class for representing components within an iCalendar

Package: awl\iCalendar
Copyright: Catalyst IT Ltd, Morphoss Ltd http://www.morphoss.com/
License: GNU GPL v2 or later
Author: Andrew McMillan andrew@mcmillan.net.nz
Located at iCalendar.php
Methods summary
public
# iCalComponent( $content = null )

A basic constructor

A basic constructor

public
# VCalendar( array $extra_properties = null )

Apply standard properties for a VCalendar

Apply standard properties for a VCalendar

Parameters

$extra_properties
Key/value pairs of additional properties
public
# CollectParameterValues( $parameter_name )

Collect an array of all parameters of our properties which are the specified type Mainly used for collecting the full variety of references TZIDs

Collect an array of all parameters of our properties which are the specified type Mainly used for collecting the full variety of references TZIDs

public
# ParseFrom( string $content )

Parse the text $content into sets of iCalProp & iCalComponent within this iCalComponent

Parse the text $content into sets of iCalProp & iCalComponent within this iCalComponent

Parameters

$content
The raw RFC2445-compliant iCalendar component, including BEGIN:TYPE & END:TYPE
public
# UnwrapComponent( $content )

This unescapes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We accept either case.

This unescapes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We accept either case.

public
# WrapComponent( $content )

This imposes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We output RFC2445 compliance.

This imposes the (CRLF + linear space) wrapping specified in RFC2445. According to RFC2445 we should always end with CRLF but the CalDAV spec says that normalising XML parsers often muck with it and may remove the CR. We output RFC2445 compliance.

In order to preserve pre-existing wrapping in the component, we split the incoming string on line breaks before running wordwrap over each component of that.

public
# GetType( )

Return the type of component which this is

Return the type of component which this is

public
# SetType( $type )

Set the type of component which this is

Set the type of component which this is

public
# GetProperties( $type = null )

Get all properties, or the properties matching a particular type

Get all properties, or the properties matching a particular type

public string
# GetPValue( string $type )

Get the value of the first property matching the name. Obviously this isn't so useful for properties which may occur multiply, but most don't.

Get the value of the first property matching the name. Obviously this isn't so useful for properties which may occur multiply, but most don't.

Parameters

$type
The type of property we are after.

Returns

string
The value of the property, or null if there was no such property.
public string
# GetPParamValue( string $type, string $parameter_name )

Get the value of the specified parameter for the first property matching the name. Obviously this isn't so useful for properties which may occur multiply, but most don't.

Get the value of the specified parameter for the first property matching the name. Obviously this isn't so useful for properties which may occur multiply, but most don't.

Parameters

$type
The type of property we are after.
$parameter_name
$type The name of the parameter we are after.

Returns

string
The value of the parameter for the property, or null in the case that there was no such property, or no such parameter.
public
# ClearProperties( string $type = null )

Clear all properties, or the properties matching a particular type

Clear all properties, or the properties matching a particular type

Parameters

$type
The type of property - omit for all properties
public
# SetProperties( $new_properties, $type = null )

Set all properties, or the ones matching a particular type

Set all properties, or the ones matching a particular type

public
# AddProperty( iCalProp $new_property, string $value = null, array $parameters = null )

Adds a new property

Adds a new property

Parameters

$new_property
The new property to append to the set, or a string with the name
$value
The value of the new property (default: param 1 is an iCalProp with everything
$parameters
The key/value parameter pairs (default: none, or param 1 is an iCalProp with everything)
public array &
# FirstNonTimezone( $type = null )

Get all sub-components, or at least get those matching a type

Get all sub-components, or at least get those matching a type

Returns

array
an array of the sub-components
public boolean
# IsOrganizer( string $email )

Return true if the person identified by the email address is down as an organizer for this meeting.

Return true if the person identified by the email address is down as an organizer for this meeting.

Parameters

$email
The e-mail address of the person we're seeking.

Returns

boolean
true if we found 'em, false if we didn't.
public boolean
# IsAttendee( string $email )

Return true if the person identified by the email address is down as an attendee or organizer for this meeting.

Return true if the person identified by the email address is down as an attendee or organizer for this meeting.

Parameters

$email
The e-mail address of the person we're seeking.

Returns

boolean
true if we found 'em, false if we didn't.
public array
# GetComponents( string $type = null, boolean $normal_match = true )

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

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

Parameters

$type
The type to match (default: All)
$normal_match
Set to false to invert the match (default: true)

Returns

array
an array of the sub-components
public
# ClearComponents( string $type = null )

Clear all components, or the components matching a particular type

Clear all components, or the components matching a particular type

Parameters

$type
The type of component - omit for all components
public
# SetComponents( array $new_component, string $type = null )

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

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

Parameters

$new_component
iCalComponent $new_components The new components to replace the existing ones
$type
The type of components to be replaced. Defaults to null, which means all components will be replaced.
public
# AddComponent( iCalComponent $new_component )

Adds a new subcomponent

Adds a new subcomponent

Parameters

$new_component
The new component to append to the set
public
# MaskComponents( array $keep )

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

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

Parameters

$keep
An array of component types to be kept
public
# MaskProperties( array $keep, array $component_list = null )

Mask properties, removing any that are not in the list

Mask properties, removing any that are not in the list

Parameters

$keep
An array of property names to be kept
$component_list
An array of component types to check within
public
# CloneConfidential( )

Clone this component (and subcomponents) into a confidential version of it. A confidential event will be scrubbed of any identifying characteristics other than time/date, repeat, uid and a summary which is just a translated 'Busy'.

Clone this component (and subcomponents) into a confidential version of it. A confidential event will be scrubbed of any identifying characteristics other than time/date, repeat, uid and a summary which is just a translated 'Busy'.

public string
# RenderWithoutWrap( null $restricted_properties = null )

this function supstitute function from vCalendar::RenderWithoutWrap NOTE: vCalendar::RenderWithoutWrap - return string without \r\n on end thats here removed the tail of iCalendar::Render which return \r\n on end

this function supstitute function from vCalendar::RenderWithoutWrap NOTE: vCalendar::RenderWithoutWrap - return string without \r\n on end thats here removed the tail of iCalendar::Render which return \r\n on end

Parameters

$restricted_properties

Returns

string
  • rendered string
public
# Render( $restricted_properties = null )

Renders the component, possibly restricted to only the listed properties

Renders the component, possibly restricted to only the listed properties

public array
# GetPropertiesByPath( $path )

Return an array of properties matching the specified path

Return an array of properties matching the specified path

Returns

array

An array of iCalProp within the tree which match the path given, in the form [/]COMPONENT[/...]/PROPERTY in a syntax kind of similar to our poor man's XML queries. We also allow COMPONENT and PROPERTY to be !COMPONENT and !PROPERTY for ++fun.

Note

At some point post PHP4 this could be re-done with an iterator, which should be more efficient for common use cases.
Properties summary
public string $type

The type of this component, such as 'VEVENT', 'VTODO', 'VTIMEZONE', etc.

The type of this component, such as 'VEVENT', 'VTODO', 'VTIMEZONE', etc.

#
public array $properties

An array of properties, which are iCalProp objects

An array of properties, which are iCalProp objects

#
public array $components

An array of (sub-)components, which are iCalComponent objects

An array of (sub-)components, which are iCalComponent objects

#
public array $rendered

The rendered result (or what was originally parsed, if there have been no changes)

The rendered result (or what was originally parsed, if there have been no changes)

#
API documentation generated by ApiGen