ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\VObject\Property\Uri Class Reference

URI property. More...

+ Inheritance diagram for Sabre\VObject\Property\Uri:
+ Collaboration diagram for Sabre\VObject\Property\Uri:

Public Member Functions

 getValueType ()
 Returns the type of value. More...
 
 parameters ()
 Returns an iterable list of children. More...
 
 setRawMimeDirValue ($val)
 Sets a raw value coming from a mimedir (iCalendar/vCard) file. More...
 
 getRawMimeDirValue ()
 Returns a raw mime-dir representation of the value. More...
 
- Public Member Functions inherited from Sabre\VObject\Property\Text
 __construct (Component $root, $name, $value=null, array $parameters=[], $group=null)
 Creates the property. More...
 
 setRawMimeDirValue ($val)
 Sets a raw value coming from a mimedir (iCalendar/vCard) file. More...
 
 setQuotedPrintableValue ($val)
 Sets the value as a quoted-printable encoded string. More...
 
 getRawMimeDirValue ()
 Returns a raw mime-dir representation of the value. More...
 
 getJsonValue ()
 Returns the value, in the format it should be encoded for json. More...
 
 getValueType ()
 Returns the type of value. More...
 
 serialize ()
 Turns the object back into a serialized blob. More...
 
 validate ($options=0)
 Validates the node for correctness. More...
 
- Public Member Functions inherited from Sabre\VObject\Property
 __construct (Component $root, $name, $value=null, array $parameters=[], $group=null)
 Creates the generic property. More...
 
 setValue ($value)
 Updates the current value. More...
 
 getValue ()
 Returns the current value. More...
 
 setParts (array $parts)
 Sets a multi-valued property. More...
 
 getParts ()
 Returns a multi-valued property. More...
 
 add ($name, $value=null)
 Adds a new parameter. More...
 
 parameters ()
 Returns an iterable list of children. More...
 
 getValueType ()
 Returns the type of value. More...
 
 setRawMimeDirValue ($val)
 Sets a raw value coming from a mimedir (iCalendar/vCard) file. More...
 
 getRawMimeDirValue ()
 Returns a raw mime-dir representation of the value. More...
 
 serialize ()
 Turns the object back into a serialized blob. More...
 
 getJsonValue ()
 Returns the value, in the format it should be encoded for JSON. More...
 
 setJsonValue (array $value)
 Sets the JSON value, as it would appear in a jCard or jCal object. More...
 
 jsonSerialize ()
 This method returns an array, with the representation as it should be encoded in JSON. More...
 
 setXmlValue (array $value)
 Hydrate data from a XML subtree, as it would appear in a xCard or xCal object. More...
 
 xmlSerialize (Xml\Writer $writer)
 This method serializes the data into XML. More...
 
 __toString ()
 Called when this object is being cast to a string. More...
 
 offsetExists ($name)
 Checks if an array element exists. More...
 
 offsetGet ($name)
 Returns a parameter. More...
 
 offsetSet ($name, $value)
 Creates a new parameter. More...
 
 offsetUnset ($name)
 Removes one or more parameters with the specified name. More...
 
 __clone ()
 This method is automatically called when the object is cloned. More...
 
 validate ($options=0)
 Validates the node for correctness. More...
 
 destroy ()
 Call this method on a document if you're done using it. More...
 
- Public Member Functions inherited from Sabre\VObject\Node
 serialize ()
 Serializes the node into a mimedir format. More...
 
 jsonSerialize ()
 This method returns an array, with the representation as it should be encoded in JSON. More...
 
 xmlSerialize (Xml\Writer $writer)
 This method serializes the data into XML. More...
 
 destroy ()
 Call this method on a document if you're done using it. More...
 
 getIterator ()
 Returns the iterator for this object. More...
 
 setIterator (ElementList $iterator)
 Sets the overridden iterator. More...
 
 validate ($options=0)
 Validates the node for correctness. More...
 
 count ()
 Returns the number of elements. More...
 
 offsetExists ($offset)
 Checks if an item exists through ArrayAccess. More...
 
 offsetGet ($offset)
 Gets an item through ArrayAccess. More...
 
 offsetSet ($offset, $value)
 Sets an item through ArrayAccess. More...
 
 offsetUnset ($offset)
 Sets an item through ArrayAccess. More...
 
- Public Member Functions inherited from Sabre\Xml\XmlSerializable
 xmlSerialize (Writer $writer)
 The xmlSerialize method is called during xml writing. More...
 

Data Fields

 $delimiter = null
 
- Data Fields inherited from Sabre\VObject\Property\Text
 $delimiter = ','
 
- Data Fields inherited from Sabre\VObject\Property
 $name
 
 $group
 
 $parameters = []
 
 $delimiter = ';'
 
- Data Fields inherited from Sabre\VObject\Node
const REPAIR = 1
 The following constants are used by the validate() method. More...
 
const 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. More...
 
const 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. More...
 
 $parent
 

Additional Inherited Members

- Protected Member Functions inherited from Sabre\VObject\Property\Text
 xmlSerializeValue (Xml\Writer $writer)
 This method serializes only the value of a property. More...
 
- Protected Member Functions inherited from Sabre\VObject\Property
 xmlSerializeValue (Xml\Writer $writer)
 This method serializes only the value of a property. More...
 
- Protected Attributes inherited from Sabre\VObject\Property\Text
 $structuredValues
 
 $minimumPropertyValues
 
- Protected Attributes inherited from Sabre\VObject\Property
 $value
 
- Protected Attributes inherited from Sabre\VObject\Node
 $iterator = null
 
 $root
 

Detailed Description

URI property.

This object encodes URI values. vCard 2.1 calls these URL.

Author
Evert Pot (http://evertpot.com/) http://sabre.io/license/ Modified BSD License

Definition at line 17 of file Uri.php.

Member Function Documentation

◆ getRawMimeDirValue()

Sabre\VObject\Property\Uri::getRawMimeDirValue ( )

Returns a raw mime-dir representation of the value.

Returns
string

Definition at line 110 of file Uri.php.

References Sabre\VObject\Property\$value.

110  {
111 
112  if (is_array($this->value)) {
113  $value = $this->value[0];
114  } else {
116  }
117 
118  return strtr($value, [',' => '\,']);
119 
120  }

◆ getValueType()

Sabre\VObject\Property\Uri::getValueType ( )

Returns the type of value.

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

Returns
string

Definition at line 35 of file Uri.php.

35  {
36 
37  return 'URI';
38 
39  }

◆ parameters()

Sabre\VObject\Property\Uri::parameters ( )

Returns an iterable list of children.

Returns
array

Definition at line 46 of file Uri.php.

References Sabre\VObject\Property\$parameters.

46  {
47 
48  $parameters = parent::parameters();
49  if (!isset($parameters['VALUE']) && in_array($this->name, ['URL', 'PHOTO'])) {
50  // If we are encoding a URI value, and this URI value has no
51  // VALUE=URI parameter, we add it anyway.
52  //
53  // This is not required by any spec, but both Apple iCal and Apple
54  // AddressBook (at least in version 10.8) will trip over this if
55  // this is not set, and so it improves compatibility.
56  //
57  // See Issue #227 and #235
58  $parameters['VALUE'] = new Parameter($this->root, 'VALUE', 'URI');
59  }
60  return $parameters;
61 
62  }

◆ setRawMimeDirValue()

Sabre\VObject\Property\Uri::setRawMimeDirValue (   $val)

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

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

Parameters
string$val
Returns
void

Definition at line 74 of file Uri.php.

74  {
75 
76  // Normally we don't need to do any type of unescaping for these
77  // properties, however.. we've noticed that Google Contacts
78  // specifically escapes the colon (:) with a blackslash. While I have
79  // no clue why they thought that was a good idea, I'm unescaping it
80  // anyway.
81  //
82  // Good thing backslashes are not allowed in urls. Makes it easy to
83  // assume that a backslash is always intended as an escape character.
84  if ($this->name === 'URL') {
85  $regex = '# (?: (\\\\ (?: \\\\ | : ) ) ) #x';
86  $matches = preg_split($regex, $val, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
87  $newVal = '';
88  foreach ($matches as $match) {
89  switch ($match) {
90  case '\:' :
91  $newVal .= ':';
92  break;
93  default :
94  $newVal .= $match;
95  break;
96  }
97  }
98  $this->value = $newVal;
99  } else {
100  $this->value = strtr($val, ['\,' => ',']);
101  }
102 
103  }

Field Documentation

◆ $delimiter

Sabre\VObject\Property\Uri::$delimiter = null

Definition at line 25 of file Uri.php.


The documentation for this class was generated from the following file: