File_IMC
[ class tree: File_IMC ] [ index: File_IMC ] [ all elements ]

Class: File_IMC_Build_Vcard

Source Location: /File_IMC-0.5.0/File/IMC/Build/Vcard.php

Class Overview

File_IMC_Build
   |
   --File_IMC_Build_Vcard

This class builds a single vCard (version 3.0 or 2.1).


Author(s):

Version:

  • Release: 0.5.0

Methods


Inherited Variables

Inherited Methods

Class: File_IMC_Build

File_IMC_Build::addParam()
Adds a parameter value for a given property and parameter name.
File_IMC_Build::addValue()
Generic, all-purpose method to add a repetition of a string or array in $this->value, in a way suitable for later output as a vCard element. This appends the value to be the passed text or array value, leaving any prior values in place.
File_IMC_Build::encode()
Check if encoding parameter has been set for this property/iteration If so... it is assumed that the value has already been encoded as such Otherwide, encode the value if necessary and sets the encoding parameter
File_IMC_Build::escape()
Prepares a string so it may be safely used as vCard values. DO NOT use this with binary encodings. Operates on text in-place; does not return a value. Recursively descends into arrays.
File_IMC_Build::fetch()
Fetches a full vCard/vCal text block based on $this->value and $this->param.
File_IMC_Build::getGroup()
Gets back the group for a given property.
File_IMC_Build::getMeta()
Gets the left-side/prefix/before-the-colon (metadata) part of a vCard line, including the property identifier, the parameter list, and a colon.
File_IMC_Build::getParam()
Gets back the parameter string for a given property.
File_IMC_Build::getValue()
Generic, all-purpose method to get back the data stored in $this->value.
File_IMC_Build::getVersion()
Gets back the version of the the vCard. Only one iteration.
File_IMC_Build::reset()
Resets the vCard values and params to be blank.
File_IMC_Build::setFromArray()
Builds a vCard/vCal from a parser result array. Only send one vCard from the parse-results.
File_IMC_Build::setGroup()
Sets the group for a given property.
File_IMC_Build::setValue()
Generic, all-purpose method to store a string or array in $this->value, in a way suitable for later output as a vCard element. This forces the value to be the passed text or array value, overriding any prior values.
File_IMC_Build::setVersion()
Sets the version of the specification to use. Only one iteration.
File_IMC_Build::validateParam()
Validates parameter names and values
File_IMC_Build::_setLast()
File_IMC_Build::__toString()
Magic method to display the vCard/vCal.

Class Details

[line 55]
This class builds a single vCard (version 3.0 or 2.1).


[ Top ]


Method Detail

__construct (Constructor)   [line 69]

File_IMC_Build_Vcard __construct( [string $version = '3.0'])

Constructor

Parameters:

string   $version   —  The vCard version to build; affects which parameters are allowed and which properties are returned by fetch().

[ Top ]

addAddress   [line 716]

void addAddress( )

  • See: self::set()
  • Deprecated:
  • Access: public

[ Top ]

addCategories   [line 725]

void addCategories( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

addEmail   [line 733]

void addEmail( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

addLabel   [line 741]

void addLabel( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

addNickname   [line 749]

void addNickname( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

addOrganization   [line 757]

void addOrganization( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

addTelephone   [line 765]

void addTelephone( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

fetch   [line 610]

string fetch( )

Fetches a full vCard text block based on $this->value and

$this->param. The order of the returned properties is similar to their order in RFC 2426. Honors the value of $this->value['VERSION'] to determine which vCard properties are returned (2.1- or 3.0-compliant).

  • Return: A properly formatted vCard text block.
  • Access: public
  • Uses: self::get()

Overrides File_IMC_Build::fetch() (Fetches a full vCard/vCal text block based on $this->value and $this->param.)
[ Top ]

get   [line 580]

string get( string $prop, [int $iter = 0])

Gets back the vcard line of the specified property (property name, params, & value) this func removes the need for all the public getXxx functions...

uses the protected methods: _getADR, _getGEO, _getN, & _getORG If an encoding parameter has been specified, then it is assumed that the value has already If no encoding specified, the value will be encoded automatically as necessary

_getPROPERTY($iter) method will be used if exists ( ie _getADR() )

  • Return: The value of the property
  • Access: public

Parameters:

string   $prop   —  property
int   $iter   —  iteration default = 0

[ Top ]

getAddress   [line 773]

void getAddress( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getAgent   [line 781]

void getAgent( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getBirthday   [line 789]

void getBirthday( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getCategories   [line 797]

void getCategories( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getClass   [line 805]

void getClass( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getEmail   [line 813]

void getEmail( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getFormattedName   [line 821]

void getFormattedName( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getGeo   [line 829]

void getGeo( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getKey   [line 837]

void getKey( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getLabel   [line 845]

void getLabel( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getLogo   [line 853]

void getLogo( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getMailer   [line 861]

void getMailer( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getName   [line 869]

void getName( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getNickname   [line 877]

void getNickname( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getNote   [line 885]

void getNote( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getOrganization   [line 893]

void getOrganization( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getPhoto   [line 901]

void getPhoto( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getProductID   [line 909]

void getProductID( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getRevision   [line 917]

void getRevision( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getRole   [line 925]

void getRole( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getSortString   [line 933]

void getSortString( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getSound   [line 941]

void getSound( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getSource   [line 949]

void getSource( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getSourceName   [line 957]

void getSourceName( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getTelephone   [line 973]

void getTelephone( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getTitle   [line 981]

void getTitle( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getTZ   [line 965]

void getTZ( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getUniqueID   [line 997]

void getUniqueID( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

getURL   [line 989]

void getURL( [ $iter = 0])

  • See: self::get()
  • Deprecated:
  • Access: public

Parameters:

   $iter   — 

[ Top ]

set   [line 528]

$this set( string $prop, mixed $value, [mixed $iter = 0])

Sets the value of the specified property

for PHOTO, LOGO, SOUND, & KEY properties: if a filepath is passed:, automatically base64-encodes and sets ENCODING parameter if a URL is passed, automatically sets the VALUE=URL|URI parameter

_setPROPERTY($value,$iter) method will be used if exists ( ie _setADR() )

  • Access: public

Parameters:

string   $prop   —  property
mixed   $value   —  value when property is ADR, GEO, or N: value is an array additionaly, the array may be an associateive array ADR: post-office-box, extended-address, street-address, locality, region, postal-code, country-name GEO: latitude, longitude N: family-name, given-name, additional-name, honorific-prefix, honorific-suffix when property is ORG, value may be an string or array ORG 'organization-name','organization-unit' for all other properties, value is a string
mixed   $iter   —  iteration default = 0; pass 'new' to add an iteration

[ Top ]

setAgent   [line 1005]

void setAgent( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setBirthday   [line 1013]

void setBirthday( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setClass   [line 1021]

void setClass( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setFormattedName   [line 1029]

void setFormattedName( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setGeo   [line 1037]

void setGeo( )

  • See: self::set()
  • Deprecated:
  • Access: public

[ Top ]

setKey   [line 1046]

void setKey( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setLogo   [line 1054]

void setLogo( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setMailer   [line 1062]

void setMailer( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setName   [line 1070]

void setName( )

  • See: self::set()
  • Deprecated:
  • Access: public

[ Top ]

setNote   [line 1079]

void setNote( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setPhoto   [line 1087]

void setPhoto( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setProductID   [line 1095]

void setProductID( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setRevision   [line 1103]

void setRevision( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setRole   [line 1111]

void setRole( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setSortString   [line 1119]

void setSortString( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setSound   [line 1127]

void setSound( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setSource   [line 1135]

void setSource( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setSourceName   [line 1143]

void setSourceName( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setTitle   [line 1159]

void setTitle( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setTZ   [line 1151]

void setTZ( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setUniqueID   [line 1175]

void setUniqueID( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setURL   [line 1167]

void setURL( $val)

  • See: self::set()
  • Deprecated:
  • Access: public

Parameters:

   $val   — 

[ Top ]

setVersion   [line 74]

void setVersion( [ $val = '3.0'])

  • Access: public

Overrides File_IMC_Build::setVersion() (Sets the version of the specification to use. Only one iteration.)

Parameters:

   $val   — 

[ Top ]

validateParam   [line 100]

mixed validateParam( string $name, string $text, [string $prop = null], [int $iter = null])

Validates parameter names and values based on the vCard version (2.1 or 3.0).
  • Return: Boolean true if the parameter is valid
  • Throws: File_IMC_Exception ... if not.
  • Access: public
  • Uses: self::validateParam21()
  • Uses: self::validateParam30()

Overrides File_IMC_Build::validateParam() (Validates parameter names and values)

Parameters:

string   $name   —  The parameter name (e.g., TYPE or ENCODING).
string   $text   —  The parameter value (e.g., HOME or BASE64).
string   $prop   —  Optional, the propety name (e.g., ADR or PHOTO). Only used for error messaging.
int   $iter   —  Optional, the iteration of the property. Only used for error messaging.

[ Top ]

_getADR   [line 435]

mixed _getADR( int $iter)

Gets back the value of one ADR property iteration.
  • Return: The value of this property iteration, or ...
  • Throws: File_IMC_Exception ... if the iteration is not valid.
  • Access: protected

Parameters:

int   $iter   —  The property iteration-number to get the value for.

[ Top ]

_getGEO   [line 459]

string _getGEO( int $iter)

Gets back the value of the GEO property.
  • Return: The value of this property.
  • Access: protected

Parameters:

int   $iter   —  The property iteration-number to get

[ Top ]

_getN   [line 473]

string _getN( int $iter)

Gets back the full N property
  • Access: protected

Parameters:

int   $iter   —  The property iteration-number to get the value for.

[ Top ]

_getORG   [line 490]

string _getORG( int $iter)

Gets back the value of the ORG property.
  • Return: The value of this property.
  • Access: protected

Parameters:

int   $iter   —  The property iteration-number to get the value for.

[ Top ]

_setADR   [line 253]

$this _setADR( array $value, int $iter)

Sets the value of one entire ADR iteration.
  • Access: protected

Parameters:

array   $value   —  address components post-office-box extended-address street-address locality : (e.g., city) region : (e.g., state, province, or governorate) postal-code : (e.g., ZIP code) country-name value may be passed as a numeric or key/value array (keys coming from hCard microformat specification) each component may be a String (one repetition) or array (multiple reptitions)
int   $iter   —  iteration

[ Top ]

_setFN   [line 290]

mixed _setFN( [string $text = null], $iter)

Sets the FN property of the card. If no text is passed as the FN value, constructs an FN automatically from N property.
  • Return: Void on success
  • Throws: File_IMC_Exception ... on failure.
  • Access: protected

Parameters:

string   $text   —  Override the automatic generation of FN from N elements with the specified text.
   $iter   — 

[ Top ]

_setGEO   [line 329]

$this _setGEO( array $value, int $iter)

Sets the GEO property (both latitude and longitude)
  • Access: protected

Parameters:

array   $value   —  coords lat and lon value may be passed as a numeric or key/value array (keys coming from geo microformat specification)
int   $iter   —  iteration

[ Top ]

_setN   [line 360]

void _setN( array $value, $iter)

Sets the full N property of the vCard.
  • Access: protected

Parameters:

array   $value   —  name comonents family-name : family/last name. given-name : given/first name. additional-name : additional/middle name. honorific-prefix: prefix such as Mr., Miss, etc. honorific-suffix: suffix such as III, Jr., Ph.D., etc. value may be passed as a numeric or key/value array (keys coming from hCard microformat specification) each component may be a string or array
   $iter   — 

[ Top ]

_setORG   [line 399]

void _setORG( mixed $value, int $iter)

Sets the full value of the ORG property.

The ORG property can have one or more parts (as opposed to repetitions of values within those parts). The first part is the highest-level organization, the second part is the next-highest, the third part is the third-highest, and so on. There can by any number of parts in one ORG iteration. (This is different from other properties, such as NICKNAME, where an iteration has only one part but may have many repetitions within that part.)

  • Access: protected

Parameters:

mixed   $value   —  String (one ORG part) or array (of ORG parts) to use as the value for the property iteration.
int   $iter   —  iteration

[ Top ]

_validateParam21   [line 132]

boolean _validateParam21( string $name, string $text, string $prop, int $iter)

Validate parameters with 2.1 vcards.
  • Access: protected

Parameters:

string   $name   —  The parameter name (e.g., TYPE or ENCODING).
string   $text   —  The parameter value (e.g., HOME or BASE64).
string   $prop   —  the property name (e.g., ADR or PHOTO). Only used for error messaging.
int   $iter   —  Optional, the iteration of the property. Only used for error messaging.

[ Top ]

_validateParam30   [line 199]

boolean _validateParam30( string $name, string $text, string $prop, int $iter)

Validate parameters with 3.0 vcards.
  • Access: protected

Parameters:

string   $name   —  The parameter name (e.g., TYPE or ENCODING).
string   $text   —  The parameter value (e.g., HOME or BASE64).
string   $prop   —  the property name (e.g., ADR or PHOTO). Only used for error messaging.
int   $iter   —  the iteration of the property. Only used for error messaging.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:49:38 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.