Class vComponent

Description

A Class for representing components within an vComponent

Located in /vComponent.php (line 350)


	
			
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)
 array GetComponents ([mixed $type = null], [boolean $normal_match = true])
 void GetProperties ([ $type = null])
 array GetPropertiesByPath ( $path)
 void GetProperty ( $type)
 void GetType ()
 void MaskComponents (array $keep)
 void MaskProperties (array $keep, [array $component_list = null])
 void ParseFrom (string $content)
 void Render ([ $restricted_properties = null])
 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)
Variables
array $components (line 374)

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

  • access: protected
array $properties (line 367)

An array of properties, which are vProperty objects

  • access: protected
array $rendered (line 381)

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

  • access: protected
string $type (line 360)

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

  • access: protected
Methods
Constructor __construct (line 388)

A basic constructor

vComponent __construct ([ $content = null])
  • $content
AddComponent (line 715)

Adds a new subcomponent

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

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

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

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

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
GetComponents (line 646)

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

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

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

Return the first instance of a property of this name

void GetProperty ( $type)
  • $type
GetType (line 533)

Return the type of component which this is

void GetType ()
MaskComponents (line 733)

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
MaskProperties (line 751)

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

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

Renders the component, possibly restricted to only the listed properties

void Render ([ $restricted_properties = null])
  • $restricted_properties
SetComponents (line 701)

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

Set all properties, or the ones matching a particular type

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

Set the type of component which this is

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

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

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

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

Documentation generated on Tue, 21 Sep 2010 14:19:51 +1200 by phpDocumentor 1.4.3