PHP Класс JeroenDesloovere\VCard\VCard

Автор: Jeroen Desloovere ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$charset string Default Charset

Открытые методы

Метод Описание
addAddress ( $name = '', $extended = '', $street = '', $city = '', $region = '', $zip = '', $country = '', $type = 'WORK;POSTAL' ) Add address
addBirthday ( string $date ) Add birthday
addCompany ( string $company ) Add company
addEmail ( string $address, $type = '' ) Add email
addJobtitle ( string $jobtitle ) Add jobtitle
addLogo ( string $url, boolean $include = true ) Add Logo
addName ( $lastName = '', $firstName = '', $additional = '', $prefix = '', $suffix = '' ) Add name
addNote ( string $note ) Add note
addPhoneNumber ( string $number, $type = '' ) Add phone number
addPhoto ( string $url, boolean $include = true ) Add Photo
addRole ( string $role ) Add role
addURL ( string $url, $type = '' ) Add URL
buildVCalendar ( ) : string Build VCalender (.ics) - Safari (< iOS 8) can not open .vcf files, so we have build a workaround.
buildVCard ( ) : string Build VCard (.vcf)
download ( ) Download a vcard or vcal file to the browser.
get ( ) : string Get output as string
getCharset ( ) : string Get charset
getCharsetString ( ) : string Get charset string
getContentType ( ) : string Get content type
getFileExtension ( ) : string Get file extension
getFilename ( ) : string Get filename
getHeaders ( boolean $asAssociative ) : array Get headers
getOutput ( ) : string Get output as string iOS devices (and safari < iOS 8 in particular) can not read .vcf (= vcard) files.
getProperties ( ) : array Get properties
hasProperty ( string $key ) : boolean Has property
isIOS ( ) : boolean Is iOS - Check if the user is using an iOS-device
isIOS7 ( ) : boolean Is iOS less than 7 (should cal wrapper be returned)
save ( ) : void Save to a file
setCharset ( mixed $charset ) : void Set charset
setFilename ( mixed $value, boolean $overwrite = true, string $separator = '_' ) : void Set filename

Защищенные методы

Метод Описание
escape ( string $text ) : string Escape newline characters according to RFC2425 section 5.8.4.
fold ( string $text ) : mixed Fold a line according to RFC2425 section 5.8.1.
getUserAgent ( ) : string Returns the browser user agent string.
shouldAttachmentBeCal ( ) : boolean Checks if we should return vcard in cal wrapper

Приватные методы

Метод Описание
addMedia ( string $property, string $url, boolean $include = true, $element ) Add a photo or logo (depending on property name)
decode ( string $value ) : string Decode
setProperty ( string $element, string $key, string $value ) : void Set property

Описание методов

addAddress() публичный Метод

Add address
public addAddress ( $name = '', $extended = '', $street = '', $city = '', $region = '', $zip = '', $country = '', $type = 'WORK;POSTAL' )

addBirthday() публичный Метод

Add birthday
public addBirthday ( string $date )
$date string Format is YYYY-MM-DD

addCompany() публичный Метод

Add company
public addCompany ( string $company )
$company string

addEmail() публичный Метод

Add email
public addEmail ( string $address, $type = '' )
$address string The e-mail address

addJobtitle() публичный Метод

Add jobtitle
public addJobtitle ( string $jobtitle )
$jobtitle string The jobtitle for the person.

addName() публичный Метод

Add name
public addName ( $lastName = '', $firstName = '', $additional = '', $prefix = '', $suffix = '' )

addNote() публичный Метод

Add note
public addNote ( string $note )
$note string

addPhoneNumber() публичный Метод

Add phone number
public addPhoneNumber ( string $number, $type = '' )
$number string

addPhoto() публичный Метод

Add Photo
public addPhoto ( string $url, boolean $include = true )
$url string image url or filename
$include boolean Include the image in our vcard?

addRole() публичный Метод

Add role
public addRole ( string $role )
$role string The role for the person.

addURL() публичный Метод

Add URL
public addURL ( string $url, $type = '' )
$url string

buildVCalendar() публичный Метод

Build VCalender (.ics) - Safari (< iOS 8) can not open .vcf files, so we have build a workaround.
public buildVCalendar ( ) : string
Результат string

buildVCard() публичный Метод

Build VCard (.vcf)
public buildVCard ( ) : string
Результат string

download() публичный Метод

Download a vcard or vcal file to the browser.
public download ( )

escape() защищенный Метод

Escape newline characters according to RFC2425 section 5.8.4.
protected escape ( string $text ) : string
$text string
Результат string

fold() защищенный Метод

Fold a line according to RFC2425 section 5.8.1.
protected fold ( string $text ) : mixed
$text string
Результат mixed

get() публичный Метод

Get output as string
Устаревший: in the future
public get ( ) : string
Результат string

getCharset() публичный Метод

Get charset
public getCharset ( ) : string
Результат string

getCharsetString() публичный Метод

Get charset string
public getCharsetString ( ) : string
Результат string

getContentType() публичный Метод

Get content type
public getContentType ( ) : string
Результат string

getFileExtension() публичный Метод

Get file extension
public getFileExtension ( ) : string
Результат string

getFilename() публичный Метод

Get filename
public getFilename ( ) : string
Результат string

getHeaders() публичный Метод

Get headers
public getHeaders ( boolean $asAssociative ) : array
$asAssociative boolean
Результат array

getOutput() публичный Метод

So I build a workaround to build a .ics (= vcalender) file.
public getOutput ( ) : string
Результат string

getProperties() публичный Метод

Get properties
public getProperties ( ) : array
Результат array

getUserAgent() защищенный Метод

Returns the browser user agent string.
protected getUserAgent ( ) : string
Результат string

hasProperty() публичный Метод

Has property
public hasProperty ( string $key ) : boolean
$key string
Результат boolean

isIOS() публичный Метод

Is iOS - Check if the user is using an iOS-device
public isIOS ( ) : boolean
Результат boolean

isIOS7() публичный Метод

Is iOS less than 7 (should cal wrapper be returned)
public isIOS7 ( ) : boolean
Результат boolean

save() публичный Метод

Save to a file
public save ( ) : void
Результат void

setCharset() публичный Метод

Set charset
public setCharset ( mixed $charset ) : void
$charset mixed
Результат void

setFilename() публичный Метод

Set filename
public setFilename ( mixed $value, boolean $overwrite = true, string $separator = '_' ) : void
$value mixed
$overwrite boolean [optional] Default overwrite is true
$separator string [optional] Default separator is an underscore '_'
Результат void

shouldAttachmentBeCal() защищенный Метод

Checks if we should return vcard in cal wrapper
protected shouldAttachmentBeCal ( ) : boolean
Результат boolean

Описание свойств

$charset публичное свойство

Default Charset
public string $charset
Результат string