Parameter
VObject Parameter.
This class represents a parameter. A parameter is always tied to a property. In the case of: DTSTART;VALUE=DATE:20101108 VALUE=DATE would be the parameter name and value.
- Full name:
\Sabre\VObject\Parameter
- Parent class:
\Sabre\VObject\Node
Properties
name
Parameter name.
noName
vCard 2.1 allows parameters to be encoded without a name.
We can deduce the parameter name based on its value.
value
Parameter value.
Methods
__construct
Sets up the object.
It's recommended to use the create:: factory method instead.
Parameters:
Parameter | Type | Description |
---|---|---|
$root |
\Sabre\VObject\Document | |
$name |
string | |
$value |
string |
guessParameterNameByValue
Try to guess property name by value, can be used for vCard 2.1 nameless parameters.
Figuring out what the name should have been. Note that a ton of these are rather silly in 2014 and would probably rarely be used, but we like to be complete.
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$value |
string |
setValue
Updates the current value.
This may be either a single, or multiple strings in an array.
Parameters:
Parameter | Type | Description |
---|---|---|
$value |
string|array |
getValue
Returns the current value.
This method will always return a string, or null. If there were multiple values, it will automatically concatenate them (separated by comma).
setParts
Sets multiple values for this parameter.
Parameters:
Parameter | Type | Description |
---|---|---|
$value |
array |
getParts
Returns all values for this parameter.
If there were no values, an empty array will be returned.
addValue
Adds a value to this parameter.
If the argument is specified as an array, all items will be added to the parameter value list.
Parameters:
Parameter | Type | Description |
---|---|---|
$part |
string|array |
has
Checks if this parameter contains the specified value.
This is a case-insensitive match. It makes sense to call this for for instance the TYPE parameter, to see if it contains a keyword such as 'WORK' or 'FAX'.
Parameters:
Parameter | Type | Description |
---|---|---|
$value |
string |
serialize
Turns the object back into a serialized blob.
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.
xmlSerialize
This method serializes the data into XML. This is used to create xCard or xCal documents.
Parameters:
Parameter | Type | Description |
---|---|---|
$writer |
\Sabre\Xml\Writer | XML writer |
__toString
Called when this object is being cast to a string.
getIterator
Returns the iterator for this object.
Inherited methods
serialize
Serializes the node into a mimedir format.
- This method is abstract.
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.
- This method is abstract.
xmlSerialize
This method serializes the data into XML. This is used to create xCard or xCal documents.
- This method is abstract.
Parameters:
Parameter | Type | Description |
---|---|---|
$writer |
\Sabre\Xml\Writer | XML writer |
destroy
Call this method on a document if you're done using it.
It's intended to remove all circular references, so PHP can easily clean it up.
getIterator
Returns the iterator for this object.
setIterator
Sets the overridden iterator.
Note that this is not actually part of the iterator interface
Parameters:
Parameter | Type | Description |
---|---|---|
$iterator |
\Sabre\VObject\ElementList |
validate
Validates the node for correctness.
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:
Parameter | Type | Description |
---|---|---|
$options |
int |
count
Returns the number of elements.
offsetExists
Checks if an item exists through ArrayAccess.
This method just forwards the request to the inner iterator
Parameters:
Parameter | Type | Description |
---|---|---|
$offset |
int |
offsetGet
Gets an item through ArrayAccess.
This method just forwards the request to the inner iterator
Parameters:
Parameter | Type | Description |
---|---|---|
$offset |
int |
offsetSet
Sets an item through ArrayAccess.
This method just forwards the request to the inner iterator
Parameters:
Parameter | Type | Description |
---|---|---|
$offset |
int | |
$value |
mixed |
offsetUnset
Sets an item through ArrayAccess.
This method just forwards the request to the inner iterator
Parameters:
Parameter | Type | Description |
---|---|---|
$offset |
int |
Automatically generated on 2025-03-18