Class: File_IMC_Build
Source Location: /File_IMC-0.5.0/File/IMC/Build.php
This class helps build files in the vCard and vCalendar formats.
Author(s):
Version:
|
|
|
Child classes:
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
addParam [line 304]
void addParam(
string
$param_name, string
$param_value, [string
$prop = null], [mixed
$iter = null])
|
|
Adds a parameter value for a given property 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 property $vcard->addParam('TYPE', 'HOME', 'TEL', 0); $vcard->addParam('TYPE', 'PREF', 'TEL', 0);
Parameters:
addValue [line 464]
void addValue(
string
$prop, int
$iter, int
$part,
$vals, mixed
$value)
|
|
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:
encode [line 199]
void encode(
string
$prop, int
$iter)
|
|
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
Parameters:
escape [line 241]
void escape(
&$text, 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 144]
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
getGroup [line 347]
string getGroup(
[string
$prop = null], [int
$iter = null])
|
|
Gets back the group for a given property.
Parameters:
getMeta [line 399]
string getMeta(
string
$prop, [int
$iter = 0])
|
|
Gets the left-side/prefix/before-the-colon (metadata) part of a vCard line, including the property identifier, the parameter list, and a colon.
Parameters:
getParam [line 522]
string getParam(
string
$prop, [int
$iter = 0])
|
|
Gets back the parameter string for a given property.
Parameters:
getValue [line 491]
string getValue(
string
$prop, [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 185]
Gets back the version of the the vCard. Only one iteration.
reset [line 165]
void reset(
[string
$version = null])
|
|
Resets the vCard values and params to be blank.
Parameters:
setFromArray [line 587]
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);
Parameters:
setGroup [line 374]
void setGroup(
$groupName, [string
$prop = null], [int
$iter = null], string
$groupNAme)
|
|
Sets the group for a given property.
Parameters:
setValue [line 431]
void setValue(
string
$prop, int
$iter, int
$part, mixed
$value)
|
|
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 = '3.0'])
|
|
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()
Parameters:
validateParam [line 136]
void validateParam(
string
$name, string
$text, [string
$prop = 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:
_setLast [line 151]
void _setLast(
string
$prop, in
$iter)
|
|
Parameters:
__toString [line 643]
Magic method to display the vCard/vCal.
// set "TYPE=HOME,PREF" for the first TEL property
$vcard->addParam('TYPE', 'HOME', 'TEL', 0 );
$vcard->addParam('TYPE', 'PREF', 'TEL', 0 );
echo $vcard;
Documentation generated on Mon, 11 Mar 2019 15:49:38 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|