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

Float property. More...

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

Public Member Functions

 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...
 
 getValueType ()
 Returns the type of value. More...
 
 getJsonValue ()
 Returns the value, in the format it should be encoded for JSON. More...
 
 setXmlValue (array $value)
 Hydrate data from a XML subtree, as it would appear in a xCard or xCal object. 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 = ';'
 
- 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
 

Protected Member Functions

 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...
 

Additional Inherited Members

- Protected Attributes inherited from Sabre\VObject\Property
 $value
 
- Protected Attributes inherited from Sabre\VObject\Node
 $iterator = null
 
 $root
 

Detailed Description

Float property.

This object represents FLOAT values. These can be 1 or more floating-point numbers.

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

Definition at line 18 of file FloatValue.php.

Member Function Documentation

◆ getJsonValue()

Sabre\VObject\Property\FloatValue::getJsonValue ( )

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

This method must always return an array.

Returns
array

Definition at line 83 of file FloatValue.php.

References Sabre\VObject\Property\getParts().

83  {
84 
85  $val = array_map('floatval', $this->getParts());
86 
87  // Special-casing the GEO property.
88  //
89  // See:
90  // http://tools.ietf.org/html/draft-ietf-jcardcal-jcal-04#section-3.4.1.2
91  if ($this->name === 'GEO') {
92  return [$val];
93  }
94 
95  return $val;
96 
97  }
getParts()
Returns a multi-valued property.
Definition: Property.php:152
+ Here is the call graph for this function:

◆ getRawMimeDirValue()

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

Returns a raw mime-dir representation of the value.

Returns
string

Definition at line 53 of file FloatValue.php.

References Sabre\VObject\Property\getParts().

53  {
54 
55  return implode(
56  $this->delimiter,
57  $this->getParts()
58  );
59 
60  }
getParts()
Returns a multi-valued property.
Definition: Property.php:152
+ Here is the call graph for this function:

◆ getValueType()

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

Returns the type of value.

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

Returns
string

Definition at line 70 of file FloatValue.php.

70  {
71 
72  return 'FLOAT';
73 
74  }

◆ setRawMimeDirValue()

Sabre\VObject\Property\FloatValue::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 38 of file FloatValue.php.

References Sabre\VObject\Property\setParts().

38  {
39 
40  $val = explode($this->delimiter, $val);
41  foreach ($val as &$item) {
42  $item = (float)$item;
43  }
44  $this->setParts($val);
45 
46  }
setParts(array $parts)
Sets a multi-valued property.
Definition: Property.php:138
+ Here is the call graph for this function:

◆ setXmlValue()

Sabre\VObject\Property\FloatValue::setXmlValue ( array  $value)

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

Parameters
array$value
Returns
void

Definition at line 107 of file FloatValue.php.

107  {
108 
109  $value = array_map('floatval', $value);
110  parent::setXmlValue($value);
111 
112  }

◆ xmlSerializeValue()

Sabre\VObject\Property\FloatValue::xmlSerializeValue ( Xml\Writer  $writer)
protected

This method serializes only the value of a property.

This is used to create xCard or xCal documents.

Parameters
Xml\Writer$writerXML writer.
Returns
void

Definition at line 122 of file FloatValue.php.

References Sabre\VObject\Property\$value, and Sabre\VObject\Property\getParts().

122  {
123 
124  // Special-casing the GEO property.
125  //
126  // See:
127  // http://tools.ietf.org/html/rfc6321#section-3.4.1.2
128  if ($this->name === 'GEO') {
129 
130  $value = array_map('floatval', $this->getParts());
131 
132  $writer->writeElement('latitude', $value[0]);
133  $writer->writeElement('longitude', $value[1]);
134 
135  }
136  else {
137  parent::xmlSerializeValue($writer);
138  }
139 
140  }
getParts()
Returns a multi-valued property.
Definition: Property.php:152
+ Here is the call graph for this function:

Field Documentation

◆ $delimiter

Sabre\VObject\Property\FloatValue::$delimiter = ';'

Definition at line 26 of file FloatValue.php.


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