Class: File_IMC_Build
Source Location: /File_IMC-0.3/File/IMC/Build.php
This class helps build files in the vCard and vCalendar formats.
Author(s):
|
|
|
Child classes:
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
addParam [line 222]
mixed addParam(
string
$param_name, string
$param_value, [string
$comp = null], [mixed
$iter = null])
|
|
Adds a parameter value for a given component and parameter name. Note that although vCard 2.1 and vCalendar allow you to specify a parameter value without a name (e.g., "HOME" instead of "TYPE=HOME") this class is not so lenient. ;-) You must specify a parameter name (TYPE, ENCODING, etc) when adding a parameter. Call multiple times if you want to add multiple values to the same parameter. E.g.: $vcard = File_IMC::build('vCard'); // set "TYPE=HOME,PREF" for the first TEL component $vcard->addParam('TYPE', 'HOME', 'TEL', 0); $vcard->addParam('TYPE', 'PREF', 'TEL', 0);
Parameters:
addValue [line 349]
void addValue(
string
$comp, int
$iter, int
$part, mixed
$text)
|
|
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.
Parameters:
escape [line 158]
mixed escape(
mixed
&$text)
|
|
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. Escapes a string so that... ; => \; , => \, newline => literal \n
Parameters:
fetch [line 521]
Fetches a full vCard/vCal text block based on $this->value and $this->param.
Overridden in child classes as:
- File_IMC_Build_vCard::fetch()
- Fetches a full vCard text block based on $this->value and
File_IMC_Build_vCard [line 77]
void File_IMC_Build_vCard(
[string
$version = '3.0'])
|
|
Constructor
Parameters:
getMeta [line 293]
string getMeta(
string
$comp, [int
$iter = 0])
|
|
Gets the left-side/prefix/before-the-colon (metadata) part of a vCard line, including the component identifier, the parameter list, and a colon.
Parameters:
getParam [line 412]
string getParam(
string
$comp, [int
$iter = 0])
|
|
Gets back the parameter string for a given component.
Parameters:
getValue [line 376]
string getValue(
string
$comp, [int
$iter = 0], [int
$part = 0], [mixed
$rept = null])
|
|
Generic, all-purpose method to get back the data stored in $this->value.
Parameters:
getVersion [line 137]
Gets back the version of the the vCard. Only one iteration.
raiseError [line 526]
void raiseError(
mixed
$msg, mixed
$code)
|
|
reset [line 92]
void reset(
[string
$version = null])
|
|
Resets the vCard values and params to be blank.
Parameters:
setFromArray [line 473]
void setFromArray(
array
$src)
|
|
Builds a vCard/vCal from a parser result array. Only send one vCard from the parse-results. Usage (to build from first vCard in parsed results): $parse = File_IMC::parse('vCard'); // new parser $info = $parse->fromFile('sample.vcf'); // parse file $vcard = File_IMC::build('vCard'); // new builder $vcard->setFromArray($info[0]); // [0] is the first card
Parameters:
setValue [line 324]
void setValue(
string
$comp, int
$iter, int
$part, mixed
$text)
|
|
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.
Parameters:
setVersion [line 118]
mixed setVersion(
string
$text)
|
|
Sets the version of the specification to use. Only one iteration. Overload this function in the driver to validate and set the version
Overridden in child classes as:
- File_IMC_Build_vCard::setVersion()
- Sets the version of the the vCard. Only one iteration.
Parameters:
validateParam [line 274]
mixed validateParam(
string
$name, string
$text, [string
$comp = null], [string
$iter = null])
|
|
Validates parameter names and values
Overridden in child classes as:
- File_IMC_Build_vCard::validateParam()
- Validates parameter names and values based on the vCard version (2.1 or 3.0).
Parameters:
Documentation generated on Sat, 1 May 2004 00:42:13 +0200 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.
|
|