Class PhpiCalLib_ContentLine

Description

Represents a contentline token.

ContentLines in iCalendar mostly represent properties, but sometimes indicate the start/end of a component.

Located in /contentline.php (line 105)


	
			
Direct descendents
Class Description
PhpiCalLib_PropertyFactory The factory class for creating the right kind of PhpiCalLib_ContentLine objects.
PhpiCalLib_Properties_TextProperty Many properties specify a value of type "text". This base class can be used for those.
PhpiCalLib_Properties_UnencodedProperty For properties that require no encoding of the value.
Variable Summary
static string $IanaTokenRegex
static string $NameSplitRegex
array $aParameters
string $EncodedValue
string $Name
PHPICALLIB_PROPERTY_? $Type
Method Summary
static string ToPropertyName (integer $Type)
static int ToPropertyType (string $Name)
PhpiCalLib_ContentLine __construct ()
void AddParameter (PhpiCalLib_Parameter $Parameter)
void Copy ( $Other, PhpiCalLib_ContentLine $ContentLine)
A Create (string $UnfoldedContentLine)
string GetEncodedValue ()
void GetName ()
string GetParameter ( $Type, [string $Name = null])
array GetParameters ([ $Type = null], [string $Name = null])
PHPICALLIB_PROPERTY_* GetType ()
void RemoveParameter ( $Type, [string $Name = null])
void RemoveParameterPermitted (integer $Type, string $Name)
void SetEncodedValue (string $Value)
void SetName (string $Name)
void SetParameter (PhpiCalLib_Parameter $Parameter)
void SetParameterPermitted ( $Parameter, PhpiCalLib_Parameter $ContentLine)
void SetParameters (array $aParameters)
void SetType (integer $Type)
array ToContentLines ( $iCalString, string $String)
A ToString ()
Variables
static string $IanaTokenRegex = '[a-zA-Z0-9-]+' (line 198)

Regex to capture validate an iana-token

static string $NameSplitRegex = '[a-zA-Z0-9-]+' (line 215)

Regex to validate a name token

A quick regular expression to validate the name token ==> name = iana-token / x-name iana-token = 1*(ALPHA / DIGIT / "-") x-name = "X-" [vendorid "-"] 1*(ALPHA / DIGIT / "-") vendorid = 3*(ALPHA / DIGIT) ==> name = 1*(ALPHA / DIGIT / "-") / "X-" [3*(ALPHA / DIGIT) "-"] 1*(ALPHA / DIGIT / "-") ==> name = 1*(ALPHA / DIGIT / "-")

  • access: public
array $aParameters = null (line 120)

The "param" tokens

  • access: protected
array $aPermittedParameters = array() (line 189)

Info about which parameters are permitted for this property

Empty array means all parameters are permitted. Each entry is keyed by id. The values indicate the min and max number of instances. For example, the spec says this for ATTENDEE. http://tools.ietf.org/html/draft-ietf-calsify-rfc2445bis-08#section-3.8.4.1

        attparam   = *(

                   ; the following are OPTIONAL,
                   ; but MUST NOT occur more than once
                   (";" cutypeparam) / (";" memberparam) /
                   (";" roleparam) / (";" partstatparam) /
                   (";" rsvpparam) / (";" deltoparam) /
                   (";" delfromparam) / (";" sentbyparam) /
                   (";" cnparam) / (";" dirparam) /
                   (";" languageparam) /

                   ; the following is OPTIONAL,
                   ; and MAY occur more than once
                   (";" other-param)

                   )

This would be implemented as:

  1.  $this->aPermittedParameters array(
  2.                 //                   ; the following are OPTIONAL,
  3.                 //                   ; but MUST NOT occur more than once
  4.                 //                   (";" cutypeparam) / (";" memberparam) /
  5.                 //                   (";" roleparam) / (";" partstatparam) /
  6.                 //                   (";" rsvpparam) / (";" deltoparam) /
  7.                 //                   (";" delfromparam) / (";" sentbyparam) /
  8.                 //                   (";" cnparam) / (";" dirparam) /
  9.                 //                   (";" languageparam) /
  10.                 PHPICALLIB_PARAMETER_CUTYPE => array(0,1),
  11.                 PHPICALLIB_PARAMETER_MEMBER => array(0,1),
  12.                 PHPICALLIB_PARAMETER_ROLE => array(0,1),
  13.                 PHPICALLIB_PARAMETER_PARTSTAT => array(0,1),
  14.                 PHPICALLIB_PARAMETER_RSVP => array(0,1),
  15.                 PHPICALLIB_PARAMETER_DELEGATED_TO => array(0,1),
  16.                 PHPICALLIB_PARAMETER_DELEGATED_FROM => array(0,1),
  17.                 PHPICALLIB_PARAMETER_SENT_BY => array(0,1),
  18.                 PHPICALLIB_PARAMETER_CN => array(0,1),
  19.                 PHPICALLIB_PARAMETER_DIR => array(0,1),
  20.                 PHPICALLIB_PARAMETER_LANGUAGE => array(0,1),
  21.                 //                   ; the following is OPTIONAL,
  22.                 //                   ; and MAY occur more than once
  23.                 //                   (";" other-param)
  24.                 PHPICALLIB_PARAMETER_IANAPARAM => array(0,-1),
  25.                 PHPICALLIB_PARAMETER_XPARAM => array(0,-1),

Note that this mechanism isn't sufficient to ensure the property only has valid parameters, for example two parameters may be mutually exclusive. Where that is the case the user should override (@link AddParameterPermitted()}, RemoveParameterPermitted or SetParameterPermitted to make sure that any remaining rules have been followed.

  • var: Keyed by PHPICALLIB_PARAMETER_* ids, value is an array(mininstances, maxinstances)
  • access: protected
string $EncodedValue = '' (line 125)

The "value" token

  • access: protected
string $Name = '' (line 110)

The "name" token

  • access: protected
PHPICALLIB_PROPERTY_? $Type = 0 (line 115)

An enumerated version of $Name

  • access: protected
Methods
static method ToPropertyName (line 412)

Convert a property type to it's defined name

  • return: A "name" RFC2445 token
  • access: public
static string ToPropertyName (integer $Type)
  • integer $Type: one of the PHPICALLIB_PROPERTY_* properties
static method ToPropertyType (line 390)

Convert a property name to it's defined type

  • return: one of the PHPICALLIB_PROPERTY_* properties
  • access: public
static int ToPropertyType (string $Name)
  • string $Name: a "name" RFC2445 token
AddParameter (line 618)

Add a new parameter

  • access: public
void AddParameter (PhpiCalLib_Parameter $Parameter)
AddParameterPermitted (line 863)

Determine if the given parameter is permitted for addition

  • access: protected
void AddParameterPermitted (PhpiCalLib_Parameter $Parameter)
Copy (line 310)

Copy from the other object

  • access: public
void Copy ( $Other, PhpiCalLib_ContentLine $ContentLine)
Create (line 726)

Parse a contentline from the unfolded string, returning the new object

  • return: PhpiCalLib_ContentLine derived class, according to what CreateContentLine returned
  • access: public
A Create (string $UnfoldedContentLine)
  • string $UnfoldedContentLine: The unfolded line that we think represents a contentline
CreateContentLine (line 714)

Create a new ContentLine object

A component would override this class, providing a new version of this function in order to choose the right kind of class to create. The alternative is to create a generic ContentLine object, then us Copy() to establish the specialised version, but it's better to create the right object up front.

  • return: derived class
  • access: protected
PhpiCalLib_ContentLine CreateContentLine (string $Name)
  • string $Name: The name of the contentline

Redefined in descendants as:
GetEncodedValue (line 678)

Access the property value as an encoded value

  • access: public
string GetEncodedValue ()
GetName (line 420)

Get the name of the property

  • access: public
void GetName ()
GetParameter (line 536)

Get the parameter of the given name, returning a single PhpiCalLib object

If there are multiple parameters of the given name, it will just return the first

  • return: PhpiCalLib_Parameter object, or null if the parameter value isn't specified
  • access: public
string GetParameter ( $Type, [string $Name = null])
  • string $Name: The name of the parameter to return
  • $Type
GetParameters (line 497)

Access the parameters

  • return: of PhpiCalLib_Parameter objects
  • access: public
array GetParameters ([ $Type = null], [string $Name = null])
  • string $Name: If not null, specifies the name of the properties to return. If empty, all parameters will be returned
  • $Type
GetType (line 465)

Access the property type

Note this will return PHPICALLIB_PROPERTY_IANAPROP or PHPICALLIB_PROPERTY_XPROP for properties that it doesn't recognize.

  • access: public
PHPICALLIB_PROPERTY_* GetType ()
RemoveParameter (line 633)

Removes all parameters of the given name

  • access: public
void RemoveParameter ( $Type, [string $Name = null])
  • string $Name
  • $Type
RemoveParameterPermitted (line 908)

Determine if we are allowed to remove the given parameter

  • access: protected
void RemoveParameterPermitted (integer $Type, string $Name)
  • integer $Type
  • string $Name
SetEncodedValue (line 687)

Sets the property value by specifying the encoded value

  • access: public
void SetEncodedValue (string $Value)
  • string $Value

Redefined in descendants as:
SetName (line 432)

Set the new name for the property

  • access: public
void SetName (string $Name)
  • string $Name
SetParameter (line 600)

Removes all existing parameters of the given name, and adds the given parameter

  • access: public
void SetParameter (PhpiCalLib_Parameter $Parameter)
SetParameterPermitted (line 844)

Determine if the given parameter can be changed

  • access: protected
void SetParameterPermitted ( $Parameter, PhpiCalLib_Parameter $ContentLine)
SetParameters (line 568)

Set the parameters

  • access: public
void SetParameters (array $aParameters)
  • array $aParameters
SetType (line 474)

Set the type of the content line

  • access: public
void SetType (integer $Type)
  • integer $Type
ToContentLines (line 325)

Convert a string to a list of content lines

  • return: An ordered list of content lines
  • access: public
array ToContentLines ( $iCalString, string $String)
  • string $String: A string of iCalendar data that represents a set of content lines
  • $iCalString
ToString (line 822)

Convert the content line to a string

  • return: string representation in the default code page
  • access: public
A ToString ()

Documentation generated on Tue, 01 Apr 2008 00:20:02 +0100 by phpDocumentor 1.4.0