55 $this->name = strtoupper(
$name);
59 $this->name = static::guessParameterNameByValue(
$value);
65 if ($this->name ===
'') {
66 $this->noName =
false;
67 $this->name = strtoupper(
$value);
86 switch (strtoupper(
$value)) {
90 case 'QUOTED-PRINTABLE' :
199 if (is_array($this->value)) {
200 return implode(
',', $this->value);
229 if (is_array($this->value)) {
231 } elseif (is_null($this->value)) {
251 if (is_null($this->value)) {
252 $this->value = $part;
254 $this->value = array_merge((array)$this->value, (array)$part);
274 array_map(
'strtolower', (array)$this->value)
289 return $this->name .
'=';
294 return implode(
';',
$value);
298 return $this->name .
'=' . array_reduce(
300 function(
$out, $item) {
320 if (!preg_match(
'#(?: [\n":;\^,\+] )#x', $item)) {
363 foreach (explode(
',', $this->value) as
$value) {
364 $writer->writeElement(
'text',
$value);
387 if (!is_null($this->iterator))
390 return $this->iterator =
new ArrayIterator((array)$this->value);
An exception for terminatinating execution or to throw for unit testing.
A node is the root class for every element in an iCalendar of vCard object.
count()
Returns the number of elements.
__toString()
Called when this object is being cast to a string.
static guessParameterNameByValue($value)
Try to guess property name by value, can be used for vCard 2.1 nameless parameters.
__construct(Document $root, $name, $value=null)
Sets up the object.
has($value)
Checks if this parameter contains the specified value.
xmlSerialize(Xml\Writer $writer)
This method serializes the data into XML.
setParts(array $value)
Sets multiple values for this parameter.
getValue()
Returns the current value.
getParts()
Returns all values for this parameter.
jsonSerialize()
This method returns an array, with the representation as it should be encoded in JSON.
serialize()
Turns the object back into a serialized blob.
getIterator()
Returns the iterator for this object.
setValue($value)
Updates the current value.
addValue($part)
Adds a value to this parameter.
iCalendar/vCard/jCal/jCard/xCal/xCard writer object.