Jeff PHP framework
0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.
|
Data exportation class. More...
Public Member Functions | |
__construct ($opts=array()) | |
Construct an export instance. | |
exportData ($filename, $extension, $output='stream') | |
Data exportation. | |
setData ($data) | |
Sets the $_data property. | |
setFieldEnclosure ($fe) | |
Sets the $_fe property. | |
setFields ($fields) | |
Sets the $_fields property. | |
setFkeys ($fkeys) | |
Set the $_fkeys property. | |
setHead ($head) | |
Sets the $_head property. | |
setOrder ($order) | |
Sets the $_order property. | |
setRids ($rids) | |
Sets the $_rids property. | |
setSeparator ($s) | |
Sets the $_s property. | |
setSfields ($sfields) | |
Sets the $_sfields property. | |
setTable ($table) | |
Sets the $_table property. | |
Private Member Functions | |
encloseField ($field) | |
Encloses a string between the enclosire characters. | |
exportCsv ($filename, $output) | |
Data exportation in csv format. | |
getData () | |
Returns data inside an array. | |
getHeadFields ($table_structure) | |
Get column names of the given fields from a database table. | |
Private Attributes | |
$_data | |
array of data to export | |
$_fe | |
field enclosure character | |
$_fields | |
the fields to export | |
$_fkeys | |
foreign keys | |
$_head | |
whether or not to print fields' headings | |
$_order | |
the field used to sort the results | |
$_pkey | |
table primary key field | |
$_registry | |
the registry singleton instance | |
$_rids | |
the records ids to export | |
$_s | |
data separator character | |
$_sfields | |
special fields | |
$_table | |
database table |
Data exportation class.
This classed is used to export database tables or arrays of data to csv files.
Definition at line 23 of file export.class.php.
export::__construct | ( | $ | opts = array() | ) |
Construct an export instance.
array | $opts | Associative array of options:
|
Definition at line 116 of file export.class.php.
export::encloseField | ( | $ | field | ) | [private] |
Encloses a string between the enclosire characters.
mixed | $field | field to enclose |
Definition at line 361 of file export.class.php.
export::exportCsv | ( | $ | filename, |
$ | output | ||
) | [private] |
Data exportation in csv format.
string | $filename | name of the exportation file |
mixed | $output | output type. Possible values are:
|
Definition at line 259 of file export.class.php.
export::exportData | ( | $ | filename, |
$ | extension, | ||
$ | output = 'stream' |
||
) |
Data exportation.
string | $filename | name of the exportation file |
string | $extension | extension of the exportation file |
string | $output | output type. Possible values are:
|
Definition at line 244 of file export.class.php.
export::getData | ( | ) | [private] |
Returns data inside an array.
If data are already given in an array form returns them, if data are stored in a database table reads them and puts them in an aray structure.
private
Definition at line 297 of file export.class.php.
export::getHeadFields | ( | $ | table_structure | ) | [private] |
Get column names of the given fields from a database table.
array | $table_structure | database table structure as returned by mysql::getTableStructure |
Definition at line 338 of file export.class.php.
export::setData | ( | $ | data | ) |
Sets the $_data property.
array | $data | data value (see export) |
Definition at line 230 of file export.class.php.
export::setFieldEnclosure | ( | $ | fe | ) |
Sets the $_fe property.
string | $fe | field enclosure character |
Definition at line 180 of file export.class.php.
export::setFields | ( | $ | fields | ) |
Sets the $_fields property.
mixed | $fields | fields value (see export) |
Definition at line 190 of file export.class.php.
export::setFkeys | ( | $ | fkeys | ) |
Set the $_fkeys property.
array | $fkeys | foreign keys |
Definition at line 160 of file export.class.php.
export::setHead | ( | $ | head | ) |
Sets the $_head property.
bool | $head | headings visibility (see export) |
Definition at line 200 of file export.class.php.
export::setOrder | ( | $ | order | ) |
Sets the $_order property.
string | $order | sort order (see export) |
Definition at line 220 of file export.class.php.
export::setRids | ( | $ | rids | ) |
Sets the $_rids property.
mixed | $rids | rids value (see export) |
Definition at line 210 of file export.class.php.
export::setSeparator | ( | $ | s | ) |
Sets the $_s property.
string | $s | separator character |
Definition at line 170 of file export.class.php.
export::setSfields | ( | $ | sfields | ) |
Sets the $_sfields property.
array | $sfields | special fields |
Definition at line 150 of file export.class.php.
export::setTable | ( | $ | table | ) |
Sets the $_table property.
string | $table | databse table |
Definition at line 140 of file export.class.php.
export::$_data [private] |
array of data to export
Definition at line 83 of file export.class.php.
export::$_fe [private] |
field enclosure character
Definition at line 38 of file export.class.php.
export::$_fields [private] |
the fields to export
Definition at line 68 of file export.class.php.
export::$_fkeys [private] |
foreign keys
Definition at line 58 of file export.class.php.
export::$_head [private] |
whether or not to print fields' headings
Definition at line 63 of file export.class.php.
export::$_order [private] |
the field used to sort the results
Definition at line 78 of file export.class.php.
export::$_pkey [private] |
table primary key field
Definition at line 48 of file export.class.php.
export::$_registry [private] |
the registry singleton instance
Definition at line 28 of file export.class.php.
export::$_rids [private] |
the records ids to export
Definition at line 73 of file export.class.php.
export::$_s [private] |
data separator character
Definition at line 33 of file export.class.php.
export::$_sfields [private] |
special fields
Definition at line 53 of file export.class.php.
export::$_table [private] |
database table
Definition at line 43 of file export.class.php.