Class vComponent

Description

A Class for representing components within an vComponent

Located in /vComponent.php (line 382)


	
			
Direct descendents
Class Description
 class vCalendar A Class for representing components within an vComponent
Variable Summary
 array $components
 array $properties
 array $rendered
 string $type
Method Summary
 vComponent __construct ([ $content = null])
 void AddComponent (vComponent $new_component)
 void AddProperty (vProperty $new_property, [string $value = null], [array $parameters = null])
 void ClearComponents ([string $type = null])
 void ClearProperties ([string|array $type = null])
 void CollectParameterValues ( $parameter_name)
 void ComponentCount ()
 array GetComponents ([mixed $type = null], [boolean $normal_match = true])
 void GetProperties ([ $type = null])
 array GetPropertiesByPath ( $path)
 void GetProperty ( $type)
 void GetPValue ( $type)
 void GetType ()
 void MaskComponents (array $keep, [boolean $recursive = true])
 void MaskProperties (array $keep, [array $component_list = null])
 void ParseFrom (string $content)
 void Render ([ $restricted_properties = null], [ $force_rendering = false])
 void SetComponents (array $new_component, [string $type = null])
 void SetProperties ( $new_properties, [ $type = null])
 void SetType ( $type)
 boolean TestFilter ( $filters, array $filter)
 void UnwrapComponent ( $content)
 void WrapComponent ( $content)
 void __toString ()
Variables
array $components (line 406)

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

  • access: protected
array $properties (line 399)

An array of properties, which are vProperty objects

  • access: protected
array $rendered (line 413)

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

  • access: protected
string $type (line 392)

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

  • access: protected
Methods
Constructor __construct (line 420)

A basic constructor

vComponent __construct ([ $content = null])
  • $content

Redefined in descendants as:
  • vCalendar::__construct() : Constructor. If a string is passed it will be parsed as if it was an iCalendar object, otherwise a new vCalendar will be initialised with basic content. If an array of key value pairs is provided they will also be used as top-level properties.
AddComponent (line 769)

Adds a new subcomponent

void AddComponent (vComponent $new_component)
  • vComponent $new_component: The new component to append to the set
AddProperty (line 666)

Adds a new property

void AddProperty (vProperty $new_property, [string $value = null], [array $parameters = null])
  • vProperty $new_property: The new property to append to the set, or a string with the name
  • string $value: The value of the new property (default: param 1 is an vProperty with everything
  • array $parameters: The key/value parameter pairs (default: none, or param 1 is an vProperty with everything)
ClearComponents (line 724)

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
ClearProperties (line 628)

Clear all properties, or the properties matching a particular type

void ClearProperties ([string|array $type = null])
  • string|array $type: The type of property - omit for all properties - or an array associating property names with true values: array( 'PROPERTY' => true, 'PROPERTY2' => true )
CollectParameterValues (line 435)

Collect an array of all parameters of our properties which are the specified type

Mainly used for collecting the full variety of references TZIDs

void CollectParameterValues ( $parameter_name)
  • $parameter_name
ComponentCount (line 685)

Return number of components

void ComponentCount ()
GetComponents (line 699)

Get all sub-components, or at least get those matching a type, or failling to match, should the second parameter be set to false. Component types may be a string or an array associating property names with true values: array( 'TYPE' => true, 'TYPE2' => true )

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

Get all properties, or the properties matching a particular type, or matching an

array associating property names with true values: array( 'PROPERTY' => true, 'PROPERTY2' => true )

void GetProperties ([ $type = null])
  • $type
GetPropertiesByPath (line 862)

Return an array of properties matching the specified path

  • return: An array of vProperty 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.
array GetPropertiesByPath ( $path)
  • $path
GetProperty (line 583)

Return the first instance of a property of this name

void GetProperty ( $type)
  • $type
GetPValue (line 600)

Return the value of the first instance of a property of this name, or null

void GetPValue ( $type)
  • $type
GetType (line 565)

Return the type of component which this is

void GetType ()
MaskComponents (line 788)

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

void MaskComponents (array $keep, [boolean $recursive = true])
  • array $keep: An array of component types to be kept
  • boolean $recursive: (default true) Whether to recursively MaskComponents on the ones we find
MaskProperties (line 806)

Mask properties, removing any that are not in the list

void MaskProperties (array $keep, [array $component_list = null])
  • array $keep: An array of property names to be kept
  • array $component_list: An array of component types to check within
ParseFrom (line 456)

Parse the text $content into sets of vProperty & vComponent within this vComponent

void ParseFrom (string $content)
  • string $content: The raw RFC2445-compliant vComponent component, including BEGIN:TYPE & END:TYPE
Render (line 824)

Renders the component, possibly restricted to only the listed properties

void Render ([ $restricted_properties = null], [ $force_rendering = false])
  • $restricted_properties
  • $force_rendering
SetComponents (line 755)

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 vComponent $new_components The new components to replace the existing ones
SetProperties (line 650)

Set all properties, or the ones matching a particular type

void SetProperties ( $new_properties, [ $type = null])
  • $new_properties
  • $type
SetType (line 573)

Set the type of component which this is

void SetType ( $type)
  • $type
TestFilter (line 915)

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 vComponent passes the test
boolean TestFilter ( $filters, array $filter)
  • array $filter: An array of XMLElement defining the filter
  • $filters
UnwrapComponent (line 541)

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.

void UnwrapComponent ( $content)
  • $content
WrapComponent (line 553)

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.

void WrapComponent ( $content)
  • $content
__toString (line 848)
  • access: public
void __toString ()

Documentation generated on Wed, 04 Jan 2012 13:49:21 +1300 by phpDocumentor 1.4.3