Skip to content

Sabre VObject VCardConverter

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

Sabre\VObject\VCardConverter

This utility converts vcards from one version to another.

  • Class name: VCardConverter
  • Namespace: Sabre\VObject

Methods

convert

mixed Sabre\VObject\VCardConverter::convert(\Sabre\VObject\Component\VCard $input, integer $targetVersion)

Converts a vCard object to a new version.

targetVersion must be one of: Document::VCARD21 Document::VCARD30 Document::VCARD40

Currently only 3.0 and 4.0 as input and output versions.

2.1 has some minor support for the input version, it's incomplete at the moment though.

If input and output version are identical, a clone is returned.

  • Visibility: public

Arguments

convertProperty

void Sabre\VObject\VCardConverter::convertProperty(\Sabre\VObject\Component\VCard $input, \Sabre\VObject\Component\VCard $output, \Sabre\VObject\Property $property, integer $targetVersion)

Handles conversion of a single property.

  • Visibility: protected

Arguments

convertBinaryToUri

\Sabre\VObject\Property\Uri Sabre\VObject\VCardConverter::convertBinaryToUri(\Sabre\VObject\Component\VCard $output, \Sabre\VObject\Property\Uri $property, $parameters)

Converts a BINARY property to a URI property.

vCard 4.0 no longer supports BINARY properties.

  • Visibility: protected

Arguments

convertUriToBinary

\Sabre\VObject\Property\Binary|null Sabre\VObject\VCardConverter::convertUriToBinary(\Sabre\VObject\Component\VCard $output, \Sabre\VObject\Property\Uri $property, $parameters)

Converts a URI property to a BINARY property.

In vCard 4.0 attachments are encoded as data: uri. Even though these may be valid in vCard 3.0 as well, we should convert those to BINARY if possible, to improve compatibility.

  • Visibility: protected

Arguments

convertParameters40

void Sabre\VObject\VCardConverter::convertParameters40(\Sabre\VObject\Property $newProperty, array $parameters)

Adds parameters to a new property for vCard 4.0

  • Visibility: protected

Arguments

convertParameters30

void Sabre\VObject\VCardConverter::convertParameters30(\Sabre\VObject\Property $newProperty, array $parameters)

Adds parameters to a new property for vCard 3.0

  • Visibility: protected

Arguments

Clone this wiki locally