class vCard (View source)

Class to build vCard files

Properties

array<string, ?string> $properties
string $filename
string $encoding

Methods

setPhoneNumber($number, string $type = "")

Format phone number.

setPhoto(string $type, $photo)

Format photo.

void
setFormattedName(string $name)

Format name.

void
setName(string $family = "", string $first = "", string $additional = "", string $prefix = "", string $suffix = "")

Format the name.

void
setBirthday(int $date)

Format the birth date

void
setAddress(string $postoffice = "", string $extended = "", string $street = "", string $city = "", string $region = "", string $zip = "", string $country = "", string $type = "", $label = "")

Address

setLabel($postoffice = "", string $extended = "", $street = "", $city = "", $region = "", $zip = "", $country = "", $type = "HOME")

Address (old standard)

void
setEmail(string $address, string $type = "")

Add a e-mail address to this vCard

void
setNote(string $note)

mise en forme de la note

void
setTitle(string $title)

mise en forme de la fonction

void
setOrg($org)

mise en forme de la societe

void
setProdId($prodid)

mise en forme du logiciel generateur

void
setUID($uid)

mise en forme du logiciel generateur

void
setURL(string $url, $type = "")

mise en forme de l'url

getVCard()

Return string of a vcard

getFileName()

Return name of a file

string
buildVCardString(User|Contact $object, Societe $company, Translate $langs, string $urlphoto = '', string $outdir = '')

Return a VCARD string See RFC https://datatracker.ietf.org/doc/html/rfc6350

Details

setPhoneNumber($number, string $type = "")

Format phone number.

@param string $number numero de telephone

Parameters

$number
string $type

Type ('cell') @return void

setPhoto(string $type, $photo)

Format photo.

warning NON TESTE !

Parameters

string $type

Type 'image/jpeg' or 'JPEG' @param string $photo Photo @return void

$photo

void setFormattedName(string $name)

Format name.

Parameters

string $name Name

Return Value

void

void setName(string $family = "", string $first = "", string $additional = "", string $prefix = "", string $suffix = "")

Format the name.

Set also the filename to use 'firstname lastname.vcf'

Parameters

string $family

Family name

string $first

First name

string $additional

Additional (e.g. second name, nick name)

string $prefix

Title prefix (e.g. "Mr.", "Ms.", "Prof.")

string $suffix

Suffix (e.g. "sen." for senior, "jun." for junior)

Return Value

void

void setBirthday(int $date)

Format the birth date

Parameters

int $date Date

Return Value

void

void setAddress(string $postoffice = "", string $extended = "", string $street = "", string $city = "", string $region = "", string $zip = "", string $country = "", string $type = "", $label = "")

Address

Parameters

string $postoffice Postoffice
string $extended Extended
string $street Street
string $city City
string $region Region
string $zip Zip
string $country Country
string $type

Type @param string $label Label

$label

Return Value

void

setLabel($postoffice = "", string $extended = "", $street = "", $city = "", $region = "", $zip = "", $country = "", $type = "HOME")

Address (old standard)

@param string $postoffice Postoffice

Parameters

$postoffice
string $extended

Extended @param string $street Street @param string $city City @param string $region Region @param string $zip Zip @param string $country Country @param string $type Type @return void @deprecated

$street
$city
$region
$zip
$country
$type

void setEmail(string $address, string $type = "")

Add a e-mail address to this vCard

Parameters

string $address

E-mail address

string $type

(optional) The type of the e-mail (typical "PREF" or "INTERNET")

Return Value

void

void setNote(string $note)

mise en forme de la note

Parameters

string $note Note

Return Value

void

void setTitle(string $title)

mise en forme de la fonction

Parameters

string $title Title

Return Value

void

void setOrg($org)

mise en forme de la societe

@param string $org Org

Parameters

$org

Return Value

void

void setProdId($prodid)

mise en forme du logiciel generateur

@param string $prodid Prodid

Parameters

$prodid

Return Value

void

void setUID($uid)

mise en forme du logiciel generateur

@param string $uid Uid

Parameters

$uid

Return Value

void

void setURL(string $url, $type = "")

mise en forme de l'url

Parameters

string $url

URL @param string $type Type

$type

Return Value

void

getVCard()

Return string of a vcard

@return string

getFileName()

Return name of a file

@return string Filename

string buildVCardString(User|Contact $object, Societe $company, Translate $langs, string $urlphoto = '', string $outdir = '')

Return a VCARD string See RFC https://datatracker.ietf.org/doc/html/rfc6350

Parameters

User|Contact $object

Object (User or Contact)

Societe $company

Company. May be null.

Translate $langs

Lang object

string $urlphoto

Full public URL of photo

string $outdir

Directory where to store the temporary file

Return Value

string String