Overview

Packages

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

Classes

  • vComponent
  • Overview
  • Package
  • Class

Class vComponent

Created by JetBrains PhpStorm. User: milan Date: 7/4/13 Time: 12:59 PM To change this template use File | Settings | File Templates.

vObject
Extended by vComponent

Direct known subclasses

vCalendar
Package: awl\vComponent
Copyright: Morphoss Ltd http://www.morphoss.com/
License: GNU LGPL v2 or later
Author: Milan Medlik milan@morphoss.com
Located at vComponent.php
Methods summary
public
# __construct( $propstring = null, & $refData = null )

Overrides

vObject::__construct()
public
# initFromIterator( & $iterator, $begin = -1 )
public
# getIterator( )
public
# initFromText( & $plainText )
public
# rewind( )
public
# explode( )

fill arrays with components and properties if they are empty.

fill arrays with components and properties if they are empty.

basicaly the object are just pointer to memory with input data (iterator with seek address on start and end) but when you want get information of any components or properties is necessary call this function first

See

vComponent::GetComponents(), ComponentsCount(), vComponent::GetProperties(), PropertiesCount()
public
# close( )
public
# parseFrom( & $iterator )
public integer
# ComponentCount( )

count of component

count of component

Returns

integer
public integer
# propertiesCount( )

count of component

count of component

Returns

integer
public null
# getComponentAt( $position )

Parameters

$position

Returns

null
  • whet is position out of range
public
# getPropertyAt( $position )
public
# clearPropertyAt( $position )
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
# 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
# GetProperty( $type )

Return the first instance of a property of this name

Return the first instance of a property of this name

public
# GetPValue( $type )

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

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

public
# GetProperties( $type = null )

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 )

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 )

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

Note

At some point post PHP4 this could be re-done with an iterator, which should be more efficient for common use cases.
public
# ClearProperties( string|array $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 - or an array associating property names with true values: array( 'PROPERTY' => true, 'PROPERTY2' => true )

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( vProperty $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 vProperty with everything
$parameters
The key/value parameter pairs (default: none, or param 1 is an vProperty with everything)
public array
# GetComponents( mixed $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. Component types may be a string or an array associating property names with true values: array( 'TYPE' => true, 'TYPE2' => 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. Component types may be a string or an array associating property names with true values: array( 'TYPE' => true, 'TYPE2' => true )

Parameters

$type
The type(s) 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
vComponent $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( vComponent $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, boolean $recursive = true )

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
$recursive
(default true) Whether to recursively MaskComponents on the ones we find
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
# 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
# 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.

protected string
# RenderWithoutWrap( null $restricted_properties = null, boolean $force_rendering = false )

Render vComponent without wrap lines

Render vComponent without wrap lines

Parameters

$restricted_properties
$force_rendering

Returns

string
protected string
# RenderWithoutWrapFromObjects( )

Let render property by property

Let render property by property

Returns

string
protected string
# RenderWithoutWrapFromIterator( boolean $unrolledComponents )

take source data in Iterator and recreate to string

take source data in Iterator and recreate to string

Parameters

$unrolledComponents
$unroledComponents - have any components

Returns

string
  • rendered object
public string
# Render( null $restricted_properties = null, boolean $force_rendering = false )

render object to string with wraped lines

render object to string with wraped lines

Parameters

$restricted_properties
$force_rendering

Returns

string
  • rendered object
public
# isValid( )

Overrides

vObject::isValid()
public boolean
# TestFilter( array $filters )

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

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

Parameters

$filters
$filter An array of XMLElement defining the filter

Returns

boolean
Whether or not this vComponent passes the test
Methods inherited from vObject
getMaster(), invalidate(), setMaster()
Constants summary
string KEYBEGIN
# 'BEGIN:'
integer KEYBEGINLENGTH
# 6
string KEYEND
# "END:"
integer KEYENDLENGTH
# 4
string VEOL
# "\r\n"
Properties summary
public static boolean $PREPARSED
# false
Properties inherited from vObject
$lineHeap, $master, $valid
API documentation generated by ApiGen