Andrew's Web Libraries (AWL)
iCalComponent Class Reference

Public Member Functions

 __construct ( $content=null)
 
 VCalendar ( $extra_properties=null)
 
 CollectParameterValues ( $parameter_name)
 
 ParseFrom ( $content)
 
 UnwrapComponent ( $content)
 
 WrapComponent ( $content)
 
 GetType ()
 
 SetType ( $type)
 
 GetProperties ( $type=null)
 
 GetPValue ( $type)
 
 GetPParamValue ( $type, $parameter_name)
 
 ClearProperties ( $type=null)
 
 SetProperties ( $new_properties, $type=null)
 
 AddProperty ( $new_property, $value=null, $parameters=null)
 
FirstNonTimezone ( $type=null)
 
 IsOrganizer ( $email)
 
 IsAttendee ( $email)
 
 GetComponents ( $type=null, $normal_match=true)
 
 ClearComponents ( $type=null)
 
 SetComponents ( $new_component, $type=null)
 
 AddComponent ( $new_component)
 
 MaskComponents ( $keep)
 
 MaskProperties ( $keep, $component_list=null)
 
 CloneConfidential ()
 
 RenderWithoutWrap ($restricted_properties=null)
 
 Render ( $restricted_properties=null)
 
 GetPropertiesByPath ( $path)
 

Public Attributes

 $type
 
 $properties
 
 $components
 
 $rendered
 

Detailed Description

Examples:
/build/awl-Fcy7wi/awl-0.59/inc/iCalendar.php.

Definition at line 354 of file iCalendar.php.

Constructor & Destructor Documentation

◆ __construct()

iCalComponent::__construct (   $content = null)

#- A basic constructor

Definition at line 392 of file iCalendar.php.

Member Function Documentation

◆ AddComponent()

iCalComponent::AddComponent (   $new_component)

Adds a new subcomponent

Parameters
iCalComponent$new_componentThe new component to append to the set

Definition at line 785 of file iCalendar.php.

◆ AddProperty()

iCalComponent::AddProperty (   $new_property,
  $value = null,
  $parameters = null 
)

Adds a new property

Parameters
iCalProp$new_propertyThe new property to append to the set, or a string with the name
string$valueThe value of the new property (default: param 1 is an iCalProp with everything
array$parametersThe key/value parameter pairs (default: none, or param 1 is an iCalProp with everything)

Definition at line 654 of file iCalendar.php.

◆ ClearComponents()

iCalComponent::ClearComponents (   $type = null)

Clear all components, or the components matching a particular type

Parameters
string$typeThe type of component - omit for all components

Definition at line 742 of file iCalendar.php.

◆ ClearProperties()

iCalComponent::ClearProperties (   $type = null)

Clear all properties, or the properties matching a particular type

Parameters
string$typeThe type of property - omit for all properties

Definition at line 617 of file iCalendar.php.

◆ CloneConfidential()

iCalComponent::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'.

Definition at line 842 of file iCalendar.php.

◆ CollectParameterValues()

iCalComponent::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

Definition at line 423 of file iCalendar.php.

◆ FirstNonTimezone()

& iCalComponent::FirstNonTimezone (   $type = null)

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

Returns
array an array of the sub-components

Definition at line 674 of file iCalendar.php.

◆ GetComponents()

iCalComponent::GetComponents (   $type = null,
  $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.

Parameters
string$typeThe type to match (default: All)
boolean$normal_matchSet to false to invert the match (default: true)
Returns
array an array of the sub-components

Definition at line 724 of file iCalendar.php.

◆ GetPParamValue()

iCalComponent::GetPParamValue (   $type,
  $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.

Parameters
string$typeThe type of property we are after.
string$typeThe 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.

Definition at line 605 of file iCalendar.php.

◆ GetProperties()

iCalComponent::GetProperties (   $type = null)

Get all properties, or the properties matching a particular type

Definition at line 571 of file iCalendar.php.

◆ GetPropertiesByPath()

iCalComponent::GetPropertiesByPath (   $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.

There is more to the path, so we recurse into that sub-part

Our input $path was not rooted, so we recurse further

Definition at line 914 of file iCalendar.php.

◆ GetPValue()

iCalComponent::GetPValue (   $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.

Parameters
string$typeThe type of property we are after.
Returns
string The value of the property, or null if there was no such property.

Definition at line 589 of file iCalendar.php.

◆ GetType()

iCalComponent::GetType ( )

Return the type of component which this is

Definition at line 553 of file iCalendar.php.

◆ IsAttendee()

iCalComponent::IsAttendee (   $email)

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

Parameters
string$emailThe e-mail address of the person we're seeking.
Returns
boolean true if we found 'em, false if we didn't.

an organizer is an attendee, as far as we're concerned

Definition at line 705 of file iCalendar.php.

◆ IsOrganizer()

iCalComponent::IsOrganizer (   $email)

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

Parameters
string$emailThe e-mail address of the person we're seeking.
Returns
boolean true if we found 'em, false if we didn't.

Definition at line 689 of file iCalendar.php.

◆ MaskComponents()

iCalComponent::MaskComponents (   $keep)

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

Parameters
array$keepAn array of component types to be kept

Definition at line 803 of file iCalendar.php.

◆ MaskProperties()

iCalComponent::MaskProperties (   $keep,
  $component_list = null 
)

Mask properties, removing any that are not in the list

Parameters
array$keepAn array of property names to be kept
array$component_listAn array of component types to check within

Definition at line 821 of file iCalendar.php.

◆ ParseFrom()

iCalComponent::ParseFrom (   $content)

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

Parameters
string$contentThe raw RFC2445-compliant iCalendar component, including BEGIN:TYPE & END:TYPE

Definition at line 444 of file iCalendar.php.

◆ Render()

iCalComponent::Render (   $restricted_properties = null)

Renders the component, possibly restricted to only the listed properties

Definition at line 882 of file iCalendar.php.

◆ RenderWithoutWrap()

iCalComponent::RenderWithoutWrap (   $restricted_properties = null)

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

Parameters
null$restricted_properties
Returns
string - rendered string

Definition at line 872 of file iCalendar.php.

◆ SetComponents()

iCalComponent::SetComponents (   $new_component,
  $type = null 
)

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

Parameters
arrayof iCalComponent $new_components The new components to replace the existing ones
string$typeThe type of components to be replaced. Defaults to null, which means all components will be replaced.

Definition at line 771 of file iCalendar.php.

◆ SetProperties()

iCalComponent::SetProperties (   $new_properties,
  $type = null 
)

Set all properties, or the ones matching a particular type

Definition at line 638 of file iCalendar.php.

◆ SetType()

iCalComponent::SetType (   $type)

Set the type of component which this is

Definition at line 561 of file iCalendar.php.

◆ UnwrapComponent()

iCalComponent::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.

Definition at line 529 of file iCalendar.php.

◆ VCalendar()

iCalComponent::VCalendar (   $extra_properties = null)

Apply standard properties for a VCalendar

Parameters
array$extra_propertiesKey/value pairs of additional properties

Definition at line 407 of file iCalendar.php.

◆ WrapComponent()

iCalComponent::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.

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.

Definition at line 541 of file iCalendar.php.


The documentation for this class was generated from the following file: