N_FAMILY
N_FAMILY
Class representing vCard entries.
$_container : \Horde_Icalendar
The parent (containing) iCalendar object.
newComponent(string $type, \Horde_Icalendar $container) : object
Return a reference to a new component.
string | $type | The type of component to return |
\Horde_Icalendar | $container | A container that this component will be associated with. |
Reference to a HordeIcalendar* object as specified.
setAttribute(string $name, string $value, array $params = array(), boolean $append = true, array $values = false)
Sets the value of an attribute.
string | $name | The name of the attribute. |
string | $value | The value of the attribute. |
array | $params | Array containing any addition parameters for this attribute. |
boolean | $append | True to append the attribute, False to replace the first matching attribute found. |
array | $values | Array representation of $value. For comma/semicolon seperated lists of values. If not set use $value as single array element. |
setParameter(string $name, array $params = array()) : boolean
Sets parameter(s) for an (already existing) attribute. The parameter set is merged into the existing set.
string | $name | The name of the attribute. |
array | $params | Array containing any additional parameters for this attribute. |
True on success, false if no attribute $name exists.
getAttribute(string $name, boolean $params = false) : mixed
Get the value of an attribute.
string | $name | The name of the attribute. |
boolean | $params | Return the parameters for this attribute instead of its value. |
(string) The value of the attribute. (array) The parameters for the attribute or multiple values for an attribute.
getAttributeSingle(string $name) : string
Get a single value of an attribute.
If multiple values, is auto-determined by library which is preferred value to return.
string | $name | The name of the attribute. |
The value of the attribute.
getAttributeValues(string $name) : array
Gets the values of an attribute as an array. Multiple values are possible due to:
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').
string | $name | The name of the attribute. |
Multiple values for 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.
string | $name | The name of the attribute. |
mixed | $default | What to return if the attribute specified by $name does not exist. |
(mixed) The value of $name. (mixed) $default if $name does not exist.
findComponent( $childclass) : boolean|\Horde_Icalendar_*
Locates the first child component of the specified class, and returns a reference to it.
$childclass |
False if no subcomponent of the specified class exists or the requested component.
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.
string | $childclass | The type of component to find. |
string | $attribute | This attribute must be set in the component for it to match. |
string | $value | Optional value that $attribute must match. |
False if no matching subcomponent of the specified class exists, or the requested component.
toHash(boolean $paramsInKeys = false) : array
Export this entry as a hash array with tag names as keys.
boolean | $paramsInKeys | 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' |
A hash array with tag names as keys.
parsevCalendar(string $text, string $base = 'VCALENDAR', boolean $clear = true) : boolean
Parses a string containing vCalendar data.
string | $text | The data to parse. |
string | $base | The type of the base object. |
boolean | $clear | If true clears this object before parsing. |
True on successful import, false otherwise.
_getEndDifference( $a, $b) : boolean
Returns the difference between the datetime indicated by $a and the datetime indicated by $b after normalizing both values to a unix timestamp. Used when sorting timezone transitions that may contain mixed format end times.
$a | ||
$b |
True if $a < $b otherwise false.
_parseDateTime(string $text, string $tzid = false) : integer
Parses a DateTime field and returns a unix timestamp. If the field cannot be parsed then the original text is returned unmodified.
string | $text | The Icalendar datetime field value. |
string | $tzid | A timezone identifier. |
A unix timestamp.
_exportDateTime(integer|object|array $value, boolean $floating = false) : string
Export a DateTime field.
integer|object|array | $value | The time value to export (either a Horde_Date, array, or timestamp). |
boolean | $floating | Whether to return a floating date-time (without time zone information). |
The string representation of the datetime value.
_parseTZID(array $date, array $time, string $tzid) : integer
Groks the TZID and returns an offset in seconds from UTC for this date and time.
array | $date | A date hash. |
array | $time | A time hash. |
string | $tzid | A timezone ID. |
The offset from UTC in seconds for the provided timezone and date/time.
_checkEndDate(integer $t, array $times) : boolean
Utility method to aid in checking the end date of a transition.
integer | $t | The timestamp of the date we are checking. |
array | $times | A transition array. |
True if $t is before the end date of the transition otherwise false.
_exportDate(object|array $value, string $autoconvert = false) : \TODO
Exports a date field.
object|array | $value | Date object or hash. |
string | $autoconvert | If set, use this as time part to export the date as datetime when exporting to Vcalendar 1.0. Examples: '000000' or '235959' |