Skip to content

Sabre VObject Parameter

Evert Pot edited this page Jun 6, 2013 · 5 revisions

Sabre\VObject\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.

Properties

$name

public string $name

Parameter name

  • Visibility: public

$value

protected string $value

Parameter value

  • Visibility: protected

$parent

public \Sabre\VObject\Node $parent

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

$iterator

protected \Sabre\VObject\ElementList $iterator = null

Iterator override

$root

protected \Sabre\VObject\Component $root

The root document

Methods

__construct

mixed Sabre\VObject\Parameter::__construct(\Sabre\VObject\Document $root, string $name, string $value)

Sets up the object.

It's recommended to use the create:: factory method instead.

  • Visibility: public

Arguments

setValue

void Sabre\VObject\Parameter::setValue(string|array $value)

Updates the current value.

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

  • Visibility: public

Arguments

  • $value string|array

getValue

string|null Sabre\VObject\Parameter::getValue()

Returns the current value

This method will always return a string, or null. If there were multiple values, it will automatically concatinate them (separated by comma).

  • Visibility: public

setParts

void Sabre\VObject\Parameter::setParts(array $value)

Sets multiple values for this parameter.

  • Visibility: public

Arguments

  • $value array

getParts

array Sabre\VObject\Parameter::getParts()

Returns all values for this parameter.

If there were no values, an empty array will be returned.

  • Visibility: public

addValue

void Sabre\VObject\Parameter::addValue(string $part)

Adds a value to this parameter

  • Visibility: public

Arguments

  • $part string

serialize

string Sabre\VObject\Parameter::serialize()

Turns the object back into a serialized blob.

  • Visibility: public

jsonSerialize

array Sabre\VObject\Parameter::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.

  • Visibility: public

__toString

string Sabre\VObject\Parameter::__toString()

Called when this object is being cast to a string

  • Visibility: public

getIterator

\Sabre\VObject\ElementList Sabre\VObject\Parameter::getIterator()

Returns the iterator for this object

  • Visibility: public

setIterator

void Sabre\VObject\Node::setIterator(\Sabre\VObject\ElementList $iterator)

Sets the overridden iterator

Note that this is not actually part of the iterator interface

Arguments

validate

array Sabre\VObject\Node::validate(int $options)

Validates the node for correctness.

The following options are supported: - Node::REPAIR - If something is broken, and automatic repair may be attempted.

An array is returned with warnings.

Every item in the array has the following properties: * level - (number between 1 and 3 with severity information) * message - (human readable message) * node - (reference to the offending node)

Arguments

  • $options int

count

int Sabre\VObject\Node::count()

Returns the number of elements

offsetExists

bool Sabre\VObject\Node::offsetExists(int $offset)

Checks if an item exists through ArrayAccess.

This method just forwards the request to the inner iterator

Arguments

  • $offset int

offsetGet

mixed Sabre\VObject\Node::offsetGet(int $offset)

Gets an item through ArrayAccess.

This method just forwards the request to the inner iterator

Arguments

  • $offset int

offsetSet

void Sabre\VObject\Node::offsetSet(int $offset, mixed $value)

Sets an item through ArrayAccess.

This method just forwards the request to the inner iterator

Arguments

  • $offset int
  • $value mixed

offsetUnset

void Sabre\VObject\Node::offsetUnset(int $offset)

Sets an item through ArrayAccess.

This method just forwards the request to the inner iterator

Arguments

  • $offset int

Clone this wiki locally