PHP 클래스 Horde_Icalendar, horde

저자: Mike Cochrane ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$type string The component type of this class.

보호된 프로퍼티들

프로퍼티 타입 설명
$_attributes array The name/value pairs of attributes for this object (UID, DTSTART, etc.). Which are present depends on the object and on what kind of component it is.
$_components array Any children (contained) iCalendar components of this object.
$_container Horde_Icalendar The parent (containing) iCalendar object.
$_newline string According to RFC 2425, we should always use CRLF-terminated lines.
$_oldFormat These 'old' formats are defined by www.imc.org. The 'new' (non-old) formats icalendar 2.0 and vcard 3.0 are defined in rfc2426 and rfc2445 respectively.
$_version string iCalendar format version (different behavior for 1.0 and 2.0 especially with recurring events).

공개 메소드들

메소드 설명
__construct ( $version = '2.0' ) Constructor.
_exportDateTime ( integer | object | array $value, boolean $floating = false ) : string Export a DateTime field.
_exportUtcOffset ( $value ) : TODO Export a UTC Offset field.
_parseDate ( $text ) : array Parses a Date field.
_parseDateTime ( $text, $tzid = false ) : TODO Parses a DateTime field and returns a unix timestamp. If the field cannot be parsed then the original text is returned unmodified.
addComponent ( $components ) Add a vCalendar component (eg vEvent, vTimezone, etc.).
clear ( ) Clears the iCalendar object (resets the components and attributes arrays).
exportvCalendar ( ) : TODO Export as vCalendar format.
findComponent ( $childclass ) : boolean | Horde_Icalendar_ Locates the first child component of the specified class, and returns a reference to it.
findComponentByAttribute ( string $childclass, string $attribute, string $value = null ) : boolean | Horde_Icalendar_ Locates the first matching child component of the specified class, and returns a reference to it.
getAllAttributes ( string $tag = false ) : array Get attributes for all tags or for a given tag.
getAttribute ( string $name, boolean $params = false ) : mixed Get the value of an attribute.
getAttributeDefault ( string $name, mixed $default = '' ) : mixed Returns the value of an attribute, or a specified default value if the attribute does not exist.
getAttributeSingle ( string $name ) : string Get a single value of an attribute.
getAttributeValues ( string $name ) : array Gets the values of an attribute as an array. Multiple values are possible due to:
getComponent ( integer $idx ) : mixed Retrieve a specific component.
getComponentClasses ( ) : array Return the classes (entry types) we have.
getComponentCount ( ) : integer Number of components in this container.
getComponents ( ) : array Retrieve all the components.
getType ( ) : TODO TODO
newComponent ( string $type, Horde_Icalendar $container ) : object Return a reference to a new component.
parsevCalendar ( string $text, string $base = 'VCALENDAR', boolean $clear = true ) : boolean Parses a string containing vCalendar data.
removeAttribute ( string $name ) Remove all occurences of an attribute.
setAttribute ( string $name, string $value, array $params = [], boolean $append = true, array $values = false ) Sets the value of an attribute.
setParameter ( string $name, array $params = [] ) : boolean Sets parameter(s) for an (already existing) attribute. The parameter set is merged into the existing set.
setVersion ( string $version ) Sets the version of this component.
toHash ( boolean $paramsInKeys = false ) : array Export this entry as a hash array with tag names as keys.
toString ( )

보호된 메소드들

메소드 설명
_checkEndDate ( integer $t, array $times ) : boolean Utility method to aid in checking the end date of a transition.
_exportDate ( object | array $value, string $autoconvert = false ) : TODO Exports a date field.
_exportDuration ( $value ) Export a duration value.
_exportPeriod ( $value ) : TODO Export a Time Period field.
_exportvData ( string $base = 'VCALENDAR' ) : string Export this component in vCal format.
_parseDuration ( string $text ) : integer Parses a DURATION value field.
_parsePeriod ( $text ) : array Parse a Time Period field.
_parseTZID ( array $date, array $time, string $tzid ) : integer Groks the TZID and returns an offset in seconds from UTC for this date and time.
_parseTime ( $text ) : TODO Parses a Time field.
_parseUtcOffset ( $text ) : TODO Parse a UTC Offset field.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( $version = '2.0' )

_checkEndDate() 보호된 메소드

Utility method to aid in checking the end date of a transition.
protected _checkEndDate ( integer $t, array $times ) : boolean
$t integer The timestamp of the date we are checking.
$times array A transition array.
리턴 boolean True if $t is before the end date of the transition otherwise false.

_exportDate() 보호된 메소드

Exports a date field.
protected _exportDate ( object | array $value, string $autoconvert = false ) : TODO
$value object | array Date object or hash.
$autoconvert string If set, use this as time part to export the date as datetime when exporting to Vcalendar 1.0. Examples: '000000' or '235959'
리턴 TODO

_exportDateTime() 공개 메소드

Export a DateTime field.
public _exportDateTime ( integer | object | array $value, boolean $floating = false ) : string
$value integer | object | array The time value to export (either a Horde_Date, array, or timestamp).
$floating boolean Whether to return a floating date-time (without time zone information).
리턴 string The string representation of the datetime value.

_exportDuration() 보호된 메소드

Export a duration value.
protected _exportDuration ( $value )
$value TODO

_exportPeriod() 보호된 메소드

Export a Time Period field.
protected _exportPeriod ( $value ) : TODO
$value TODO
리턴 TODO

_exportUtcOffset() 공개 메소드

Export a UTC Offset field.
public _exportUtcOffset ( $value ) : TODO
$value TODO
리턴 TODO

_exportvData() 보호된 메소드

Export this component in vCal format.
protected _exportvData ( string $base = 'VCALENDAR' ) : string
$base string The type of the base object.
리턴 string vCal format data.

_parseDate() 공개 메소드

Parses a Date field.
public _parseDate ( $text ) : array
$text TODO
리턴 array TODO

_parseDateTime() 공개 메소드

Parses a DateTime field and returns a unix timestamp. If the field cannot be parsed then the original text is returned unmodified.
public _parseDateTime ( $text, $tzid = false ) : TODO
$tzid TODO
리턴 TODO

_parseDuration() 보호된 메소드

Parses a DURATION value field.
protected _parseDuration ( string $text ) : integer
$text string A DURATION value.
리턴 integer The duration in seconds.

_parsePeriod() 보호된 메소드

Parse a Time Period field.
protected _parsePeriod ( $text ) : array
$text TODO
리턴 array TODO

_parseTZID() 보호된 메소드

Groks the TZID and returns an offset in seconds from UTC for this date and time.
protected _parseTZID ( array $date, array $time, string $tzid ) : integer
$date array A date hash.
$time array A time hash.
$tzid string A timezone ID.
리턴 integer The offset from UTC in seconds for the provided timezone and date/time.

_parseTime() 보호된 메소드

Parses a Time field.
protected _parseTime ( $text ) : TODO
$text TODO
리턴 TODO

_parseUtcOffset() 보호된 메소드

Parse a UTC Offset field.
protected _parseUtcOffset ( $text ) : TODO
$text TODO
리턴 TODO

addComponent() 공개 메소드

Add a vCalendar component (eg vEvent, vTimezone, etc.).
public addComponent ( $components )

clear() 공개 메소드

Clears the iCalendar object (resets the components and attributes arrays).
public clear ( )

exportvCalendar() 공개 메소드

Export as vCalendar format.
public exportvCalendar ( ) : TODO
리턴 TODO

findComponent() 공개 메소드

Locates the first child component of the specified class, and returns a reference to it.
public findComponent ( $childclass ) : boolean | Horde_Icalendar_
리턴 boolean | Horde_Icalendar_

findComponentByAttribute() 공개 메소드

Locates the first matching child component of the specified class, and returns a reference to it.
public findComponentByAttribute ( string $childclass, string $attribute, string $value = null ) : boolean | Horde_Icalendar_
$childclass string The type of component to find.
$attribute string This attribute must be set in the component for it to match.
$value string Optional value that $attribute must match.
리턴 boolean | Horde_Icalendar_

getAllAttributes() 공개 메소드

Get attributes for all tags or for a given tag.
public getAllAttributes ( string $tag = false ) : array
$tag string Return attributes for this tag, or all attributes if not given.
리턴 array An array containing all the attributes and their types.

getAttribute() 공개 메소드

Get the value of an attribute.
public getAttribute ( string $name, boolean $params = false ) : mixed
$name string The name of the attribute.
$params boolean Return the parameters for this attribute instead of its value.
리턴 mixed (string) The value of the attribute. (array) The parameters for the attribute or multiple values for an attribute.

getAttributeDefault() 공개 메소드

Returns the value of an attribute, or a specified default value if the attribute does not exist.
public getAttributeDefault ( string $name, mixed $default = '' ) : mixed
$name string The name of the attribute.
$default mixed What to return if the attribute specified by $name does not exist.
리턴 mixed (mixed) The value of $name. (mixed) $default if $name does not exist.

getAttributeSingle() 공개 메소드

If multiple values, is auto-determined by library which is preferred value to return.
부터: 2.1.0
public getAttributeSingle ( string $name ) : string
$name string The name of the attribute.
리턴 string The value of the attribute.

getAttributeValues() 공개 메소드

a) multiple occurences of 'name' b) (unsecapd) comma seperated lists. So for a vcard like "KEY:a,b\nKEY:c" getAttributesValues('KEY') will return array('a', 'b', 'c').
public getAttributeValues ( string $name ) : array
$name string The name of the attribute.
리턴 array Multiple values for an attribute.

getComponent() 공개 메소드

Retrieve a specific component.
public getComponent ( integer $idx ) : mixed
$idx integer The index of the object to retrieve.
리턴 mixed (boolean) False if the index does not exist. (Horde_Icalendar_*) The requested component.

getComponentClasses() 공개 메소드

Return the classes (entry types) we have.
public getComponentClasses ( ) : array
리턴 array Hash with class names Horde_Icalendar_xxx as keys and number of components of this class as value.

getComponentCount() 공개 메소드

Number of components in this container.
public getComponentCount ( ) : integer
리턴 integer Number of components in this container.

getComponents() 공개 메소드

Retrieve all the components.
public getComponents ( ) : array
리턴 array Array of Horde_Icalendar objects.

getType() 공개 메소드

TODO
public getType ( ) : TODO
리턴 TODO

newComponent() 공개 정적인 메소드

Return a reference to a new component.
public static newComponent ( string $type, Horde_Icalendar $container ) : object
$type string The type of component to return
$container Horde_Icalendar A container that this component will be associated with.
리턴 object Reference to a Horde_Icalendar_* object as specified.

parsevCalendar() 공개 메소드

Parses a string containing vCalendar data.
public parsevCalendar ( string $text, string $base = 'VCALENDAR', boolean $clear = true ) : boolean
$text string The data to parse.
$base string The type of the base object.
$clear boolean If true clears this object before parsing.
리턴 boolean True on successful import, false otherwise.

removeAttribute() 공개 메소드

Remove all occurences of an attribute.
public removeAttribute ( string $name )
$name string The name of the attribute.

setAttribute() 공개 메소드

Sets the value of an attribute.
public setAttribute ( string $name, string $value, array $params = [], boolean $append = true, array $values = false )
$name string The name of the attribute.
$value string The value of the attribute.
$params array Array containing any addition parameters for this attribute.
$append boolean True to append the attribute, False to replace the first matching attribute found.
$values array Array representation of $value. For comma/semicolon seperated lists of values. If not set use $value as single array element.

setParameter() 공개 메소드

Sets parameter(s) for an (already existing) attribute. The parameter set is merged into the existing set.
public setParameter ( string $name, array $params = [] ) : boolean
$name string The name of the attribute.
$params array Array containing any additional parameters for this attribute.
리턴 boolean True on success, false if no attribute $name exists.

setVersion() 공개 메소드

Sets the version of this component.
public setVersion ( string $version )
$version string A float-like version string.

toHash() 공개 메소드

Export this entry as a hash array with tag names as keys.
public toHash ( boolean $paramsInKeys = false ) : array
$paramsInKeys boolean If false, the operation can be quite lossy as the parameters are ignored when building the array keys. So if you export a vcard with LABEL;TYPE=WORK:foo LABEL;TYPE=HOME:bar the resulting hash contains only one label field! If set to true, array keys look like 'LABEL;TYPE=WORK'
리턴 array A hash array with tag names as keys.

toString() 공개 메소드

public toString ( )

프로퍼티 상세

$_attributes 보호되어 있는 프로퍼티

The name/value pairs of attributes for this object (UID, DTSTART, etc.). Which are present depends on the object and on what kind of component it is.
protected array $_attributes
리턴 array

$_components 보호되어 있는 프로퍼티

Any children (contained) iCalendar components of this object.
protected array $_components
리턴 array

$_container 보호되어 있는 프로퍼티

The parent (containing) iCalendar object.
protected Horde_Icalendar $_container
리턴 Horde_Icalendar

$_newline 보호되어 있는 프로퍼티

According to RFC 2425, we should always use CRLF-terminated lines.
protected string $_newline
리턴 string

$_oldFormat 보호되어 있는 프로퍼티

These 'old' formats are defined by www.imc.org. The 'new' (non-old) formats icalendar 2.0 and vcard 3.0 are defined in rfc2426 and rfc2445 respectively.
protected $_oldFormat

$_version 보호되어 있는 프로퍼티

iCalendar format version (different behavior for 1.0 and 2.0 especially with recurring events).
protected string $_version
리턴 string

$type 공개적으로 프로퍼티

The component type of this class.
public string $type
리턴 string