Skip to content

Sabre VObject Property VCard DateAndOrTime

Evert Pot edited this page Sep 1, 2014 · 3 revisions

Sabre\VObject\Property\VCard\DateAndOrTime

DateAndOrTime property

This object encodes DATE-AND-OR-TIME values.

Constants

REPAIR

const REPAIR = 1

Properties

$delimiter

public string $delimiter = ';'

In case this is a multi-value property. This string will be used as a delimiter.

  • Visibility: public

$name

public string $name

Property name.

This will contain a string such as DTSTART, SUMMARY, FN.

  • Visibility: public

$group

public string $group

Property group.

This is only used in vcards

  • Visibility: public

$parameters

public array $parameters = array()

List of parameters

  • Visibility: public

$value

protected mixed $value

Current value

  • Visibility: protected

$parent

public \Sabre\VObject\Node $parent

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

  • Visibility: public

$iterator

protected \Sabre\VObject\ElementList $iterator = null

Iterator override

  • Visibility: protected

$root

protected \Sabre\VObject\Component $root

The root document

  • Visibility: protected

Methods

getValueType

string Sabre\VObject\Property\VCard\DateAndOrTime::getValueType()

Returns the type of value.

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

  • Visibility: public
  • This method is abstract.

setParts

void Sabre\VObject\Property\VCard\DateAndOrTime::setParts(array $parts)

Sets a multi-valued property.

  • Visibility: public

Arguments

  • $parts array

setValue

void Sabre\VObject\Property\VCard\DateAndOrTime::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

setDateTime

void Sabre\VObject\Property\VCard\DateAndOrTime::setDateTime(\DateTime $dt)

Sets the property as a DateTime object.

  • Visibility: public

Arguments

  • $dt DateTime

getDateTime

\DateTime Sabre\VObject\Property\VCard\DateAndOrTime::getDateTime()

Returns a date-time value.

Note that if this property contained more than 1 date-time, only the first will be returned. To get an array with multiple values, call getDateTimes.

If no time was specified, we will always use midnight (in the default timezone) as the time.

If parts of the date were omitted, such as the year, we will grab the current values for those. So at the time of writing, if the year was omitted, we would have filled in 2014.

  • Visibility: public

getJsonValue

array Sabre\VObject\Property\VCard\DateAndOrTime::getJsonValue()

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

This method must always return an array.

  • Visibility: public

setRawMimeDirValue

void Sabre\VObject\Property\VCard\DateAndOrTime::setRawMimeDirValue(string $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.

  • Visibility: public
  • This method is abstract.

Arguments

  • $val string

getRawMimeDirValue

string Sabre\VObject\Property\VCard\DateAndOrTime::getRawMimeDirValue()

Returns a raw mime-dir representation of the value.

  • Visibility: public
  • This method is abstract.

validate

array Sabre\VObject\Property\VCard\DateAndOrTime::validate(integer $options)

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.

  • Visibility: public

Arguments

  • $options integer

__construct

void Sabre\VObject\Property\VCard\DateAndOrTime::__construct(\Sabre\VObject\Component $root, string $name, string|array|null $value, array $parameters, string $group)

Creates the generic property.

Parameters must be specified in key=>value syntax.

  • Visibility: public

Arguments

  • $root Sabre\VObject\Component - <p>The root document</p>
  • $name string
  • $value string|array|null
  • $parameters array - <p>List of parameters</p>
  • $group string - <p>The vcard property group</p>

getValue

string Sabre\VObject\Property\VCard\DateAndOrTime::getValue()

Returns the current value.

This method will always return a singular value. If this was a multi-value object, some decision will be made first on how to represent it as a string.

To get the correct multi-value version, use getParts.

  • Visibility: public

getParts

array Sabre\VObject\Property\VCard\DateAndOrTime::getParts()

Returns a multi-valued property.

This method always returns an array, if there was only a single value, it will still be wrapped in an array.

  • Visibility: public

add

\Sabre\VObject\Node Sabre\VObject\Property\VCard\DateAndOrTime::add(string $name, string|null|array $value)

Adds a new parameter, and returns the new item.

If a parameter with same name already existed, the values will be combined. If nameless parameter is added, we try to guess it's name.

  • Visibility: public

Arguments

  • $name string
  • $value string|null|array

parameters

array Sabre\VObject\Property\VCard\DateAndOrTime::parameters()

Returns an iterable list of children

  • Visibility: public

serialize

string Sabre\VObject\Property\VCard\DateAndOrTime::serialize()

Serializes the node into a mimedir format

  • Visibility: public
  • This method is abstract.

setJsonValue

void Sabre\VObject\Property\VCard\DateAndOrTime::setJsonValue(array $value)

Sets the json value, as it would appear in a jCard or jCal object.

The value must always be an array.

  • Visibility: public

Arguments

  • $value array

jsonSerialize

array Sabre\VObject\Property\VCard\DateAndOrTime::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
  • This method is abstract.

__toString

string Sabre\VObject\Property\VCard\DateAndOrTime::__toString()

Called when this object is being cast to a string.

If the property only had a single value, you will get just that. In the case the property had multiple values, the contents will be escaped and combined with ,.

  • Visibility: public

offsetExists

boolean Sabre\VObject\Property\VCard\DateAndOrTime::offsetExists(integer $offset)

Checks if an item exists through ArrayAccess.

This method just forwards the request to the inner iterator

  • Visibility: public

Arguments

  • $offset integer

offsetGet

mixed Sabre\VObject\Property\VCard\DateAndOrTime::offsetGet(integer $offset)

Gets an item through ArrayAccess.

This method just forwards the request to the inner iterator

  • Visibility: public

Arguments

  • $offset integer

offsetSet

void Sabre\VObject\Property\VCard\DateAndOrTime::offsetSet(integer $offset, mixed $value)

Sets an item through ArrayAccess.

This method just forwards the request to the inner iterator

  • Visibility: public

Arguments

  • $offset integer
  • $value mixed

offsetUnset

void Sabre\VObject\Property\VCard\DateAndOrTime::offsetUnset(integer $offset)

Sets an item through ArrayAccess.

This method just forwards the request to the inner iterator

  • Visibility: public

Arguments

  • $offset integer

__clone

void Sabre\VObject\Property\VCard\DateAndOrTime::__clone()

This method is automatically called when the object is cloned.

Specifically, this will ensure all child elements are also cloned.

  • Visibility: public

getIterator

\Sabre\VObject\ElementList Sabre\VObject\Property\VCard\DateAndOrTime::getIterator()

Returns the iterator for this object

  • Visibility: public

setIterator

void Sabre\VObject\Property\VCard\DateAndOrTime::setIterator(\Sabre\VObject\ElementList $iterator)

Sets the overridden iterator

Note that this is not actually part of the iterator interface

  • Visibility: public

Arguments

count

integer Sabre\VObject\Property\VCard\DateAndOrTime::count()

Returns the number of elements

  • Visibility: public
Clone this wiki locally