Documentation

PhoneNumber extends Text
in package

PhoneNumber property.

This object encodes PHONE-NUMBER values.

Tags
author

Christian Kraus christian@kraus.work

Table of Contents

PROFILE_CALDAV  = 4
If this option is set, the validator will operate on iCalendar objects on the assumption that the vcards need to be valid for CalDAV.
PROFILE_CARDDAV  = 2
If this option is set, the validator will operate on the vcards on the assumption that the vcards need to be valid for CardDAV.
REPAIR  = 1
The following constants are used by the validate() method.
$delimiter  : string|null
In case this is a multi-value property. This string will be used as a delimiter.
$group  : string
Property group.
$name  : string
Property name.
$parameters  : array<string|int, mixed>
List of parameters.
$parent  : Node
Reference to the parent object, if this is not the top object.
$iterator  : ElementList
Iterator override.
$minimumPropertyValues  : array<string|int, mixed>
Some text components have a minimum number of components.
$root  : Component
The root document.
$structuredValues  : array<string|int, mixed>
List of properties that are considered 'structured'.
$value  : mixed
Current value.
__clone()  : mixed
This method is automatically called when the object is cloned.
__construct()  : mixed
Creates the generic property.
__toString()  : string
Called when this object is being cast to a string.
add()  : mixed
Adds a new parameter.
count()  : int
Returns the number of elements.
destroy()  : mixed
Call this method on a document if you're done using it.
getIterator()  : ElementList
Returns the iterator for this object.
getJsonValue()  : array<string|int, mixed>
Returns the value, in the format it should be encoded for JSON.
getParts()  : array<string|int, mixed>
Returns a multi-valued property.
getRawMimeDirValue()  : string
Returns a raw mime-dir representation of the value.
getValue()  : string
Returns the current value.
getValueType()  : string
Returns the type of value.
jsonSerialize()  : array<string|int, mixed>
This method returns an array, with the representation as it should be encoded in JSON. This is used to create jCard or jCal documents.
offsetExists()  : bool
Checks if an item exists through ArrayAccess.
offsetGet()  : mixed
Gets an item through ArrayAccess.
offsetSet()  : mixed
Sets an item through ArrayAccess.
offsetUnset()  : mixed
Sets an item through ArrayAccess.
parameters()  : array<string|int, mixed>
Returns an iterable list of children.
serialize()  : string
Serializes the node into a mimedir format.
setIterator()  : mixed
Sets the overridden iterator.
setJsonValue()  : mixed
Sets the JSON value, as it would appear in a jCard or jCal object.
setParts()  : mixed
Sets a multi-valued property.
setQuotedPrintableValue()  : mixed
Sets the value as a quoted-printable encoded string.
setRawMimeDirValue()  : mixed
Sets a raw value coming from a mimedir (iCalendar/vCard) file.
setValue()  : mixed
Updates the current value.
setXmlValue()  : mixed
Hydrate data from a XML subtree, as it would appear in a xCard or xCal object.
validate()  : array<string|int, mixed>
Validates the node for correctness.
xmlSerialize()  : mixed
This method serializes the data into XML. This is used to create xCard or xCal documents.
xmlSerializeValue()  : mixed
This method serializes only the value of a property. This is used to create xCard or xCal documents.

Constants

PROFILE_CALDAV

If this option is set, the validator will operate on iCalendar objects on the assumption that the vcards need to be valid for CalDAV.

public mixed PROFILE_CALDAV = 4

This means for example that calendars can only contain objects with identical component types and UIDs.

PROFILE_CARDDAV

If this option is set, the validator will operate on the vcards on the assumption that the vcards need to be valid for CardDAV.

public mixed PROFILE_CARDDAV = 2

This means for example that the UID is required, whereas it is not for regular vcards.

REPAIR

The following constants are used by the validate() method.

public mixed REPAIR = 1

If REPAIR is set, the validator will attempt to repair any broken data (if possible).

Properties

$delimiter

In case this is a multi-value property. This string will be used as a delimiter.

public string|null $delimiter = ';'

$group

Property group.

public string $group

This is only used in vcards

$name

Property name.

public string $name

This will contain a string such as DTSTART, SUMMARY, FN.

$parameters

List of parameters.

public array<string|int, mixed> $parameters = []

$parent

Reference to the parent object, if this is not the top object.

public Node $parent

$minimumPropertyValues

Some text components have a minimum number of components.

protected array<string|int, mixed> $minimumPropertyValues = ['N' => 5, 'ADR' => 7]

N must for instance be represented as 5 components, separated by ;, even if the last few components are unused.

$structuredValues

List of properties that are considered 'structured'.

protected array<string|int, mixed> $structuredValues = []

$value

Current value.

protected mixed $value

Methods

__clone()

This method is automatically called when the object is cloned.

public __clone() : mixed

Specifically, this will ensure all child elements are also cloned.

Return values
mixed

__construct()

Creates the generic property.

public __construct(Component $root, string $name[, string|array<string|int, mixed>|null $value = null ][, array<string|int, mixed> $parameters = [] ][, string $group = null ]) : mixed

Parameters must be specified in key=>value syntax.

Parameters
$root : Component

The root document

$name : string
$value : string|array<string|int, mixed>|null = null
$parameters : array<string|int, mixed> = []

List of parameters

$group : string = null

The vcard property group

Return values
mixed

__toString()

Called when this object is being cast to a string.

public __toString() : string

If the property only had a single value, you will get just that. In the case the property had multiple values, the contents will be escaped and combined with ,.

Return values
string

add()

Adds a new parameter.

public add(string $name[, string|array<string|int, mixed>|null $value = null ]) : mixed

If a parameter with same name already existed, the values will be combined. If nameless parameter is added, we try to guess its name.

Parameters
$name : string
$value : string|array<string|int, mixed>|null = null
Return values
mixed

count()

Returns the number of elements.

public count() : int
Return values
int

destroy()

Call this method on a document if you're done using it.

public destroy() : mixed

It's intended to remove all circular references, so PHP can easily clean it up.

Return values
mixed

getJsonValue()

Returns the value, in the format it should be encoded for JSON.

public getJsonValue() : array<string|int, mixed>

This method must always return an array.

Return values
array<string|int, mixed>

getParts()

Returns a multi-valued property.

public getParts() : array<string|int, mixed>

This method always returns an array, if there was only a single value, it will still be wrapped in an array.

Return values
array<string|int, mixed>

getRawMimeDirValue()

Returns a raw mime-dir representation of the value.

public abstract getRawMimeDirValue() : string
Return values
string

getValue()

Returns the current value.

public getValue() : string

This method will always return a singular value. If this was a multi-value object, some decision will be made first on how to represent it as a string.

To get the correct multi-value version, use getParts.

Return values
string

getValueType()

Returns the type of value.

public getValueType() : string

This corresponds to the VALUE= parameter. Every property also has a 'default' valueType.

Return values
string

jsonSerialize()

This method returns an array, with the representation as it should be encoded in JSON. This is used to create jCard or jCal documents.

public abstract jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

offsetExists()

Checks if an item exists through ArrayAccess.

public offsetExists(int $offset) : bool

This method just forwards the request to the inner iterator

Parameters
$offset : int
Return values
bool

offsetGet()

Gets an item through ArrayAccess.

public offsetGet(int $offset) : mixed

This method just forwards the request to the inner iterator

Parameters
$offset : int
Return values
mixed

offsetSet()

Sets an item through ArrayAccess.

public offsetSet(int $offset, mixed $value) : mixed

This method just forwards the request to the inner iterator

Parameters
$offset : int
$value : mixed
Return values
mixed

offsetUnset()

Sets an item through ArrayAccess.

public offsetUnset(int $offset) : mixed

This method just forwards the request to the inner iterator

Parameters
$offset : int
Return values
mixed

parameters()

Returns an iterable list of children.

public parameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

serialize()

Serializes the node into a mimedir format.

public abstract serialize() : string
Return values
string

setIterator()

Sets the overridden iterator.

public setIterator(ElementList $iterator) : mixed

Note that this is not actually part of the iterator interface

Parameters
$iterator : ElementList
Return values
mixed

setJsonValue()

Sets the JSON value, as it would appear in a jCard or jCal object.

public setJsonValue(array<string|int, mixed> $value) : mixed

The value must always be an array.

Parameters
$value : array<string|int, mixed>
Return values
mixed

setParts()

Sets a multi-valued property.

public setParts(array<string|int, mixed> $parts) : mixed
Parameters
$parts : array<string|int, mixed>
Return values
mixed

setQuotedPrintableValue()

Sets the value as a quoted-printable encoded string.

public setQuotedPrintableValue(string $val) : mixed
Parameters
$val : string
Return values
mixed

setRawMimeDirValue()

Sets a raw value coming from a mimedir (iCalendar/vCard) file.

public abstract setRawMimeDirValue(string $val) : mixed

This has been 'unfolded', so only 1 line will be passed. Unescaping is not yet done, but parameters are not included.

Parameters
$val : string
Return values
mixed

setValue()

Updates the current value.

public setValue(string|array<string|int, mixed> $value) : mixed

This may be either a single, or multiple strings in an array.

Parameters
$value : string|array<string|int, mixed>
Return values
mixed

setXmlValue()

Hydrate data from a XML subtree, as it would appear in a xCard or xCal object.

public setXmlValue(array<string|int, mixed> $value) : mixed
Parameters
$value : array<string|int, mixed>
Return values
mixed

validate()

Validates the node for correctness.

public validate(int $options) : array<string|int, mixed>

The following options are supported: Node::REPAIR - May attempt to automatically repair the problem.

This method returns an array with detected problems. Every element has the following properties:

  • level - problem level.
  • message - A human-readable string describing the issue.
  • node - A reference to the problematic node.

The level means: 1 - The issue was repaired (only happens if REPAIR was turned on) 2 - An inconsequential issue 3 - A severe issue.

Parameters
$options : int
Return values
array<string|int, mixed>

xmlSerialize()

This method serializes the data into XML. This is used to create xCard or xCal documents.

public abstract xmlSerialize(Writer $writer) : mixed
Parameters
$writer : Writer

XML writer

Return values
mixed

xmlSerializeValue()

This method serializes only the value of a property. This is used to create xCard or xCal documents.

protected xmlSerializeValue(Writer $writer) : mixed
Parameters
$writer : Writer

XML writer

Return values
mixed

Search results