Inherited Variables
Inherited Methods
Class: eDUtilities
- eDUtilities::introspection()
- Dumps objects and arrays.
- eDUtilities::is_defined()
- Is the string $str_ defined From what I know, yet no PHP function allows to test if a string is defined.
- eDUtilities::setTrace()
- Sets the TRACE flag, mode and format
- eDUtilities::trace()
- Print a string and flushes the output buffer
Class Details
eDDataFile - Data File Generator
This script allows the easy creation of flat data files from database records. Data to be written in the file are provided as an array of associative arrays. One associative arrays is made available per record retrieved, keys being the name of the database fields (eDQuery principle). From that list of records, a filter can be provided to indicate which fields should be extracted in the file and in which order. Other fields are ignored. Name and path of the file can be specified as well as the field and line separator. Some example of use:
- Creation of Comma Separated Values (CSV) files from database record
- Creation of flat files used as inputs by some external programs for
- ...
Tags:
- link - http://eDreamers.org
- see - eDUtilities
- author - Bertrand Potier <mailto:info@edreamers.org>
[ Top ]
Class Variables
$arr_data = array()
[line 73]
eDDataFile::$arr_data
The array of data being either a copy of the records or, if filters are provided, the extract from the records of the only fields to be included
Type: mixed
Overrides:
[ Top ]
$arr_records = array()
[line 65]
eDDataFile::$arr_records
The array of records
Type: mixed
Overrides:
[ Top ]
$int_fp = null
[line 80]
eDDataFile::$int_fp
The file pointer
Type: mixed
Overrides:
[ Top ]
$str_endofline = "\n"
[line 58]
eDDataFile::$str_endofline
Character to use to terminate a record line
Type: mixed
Overrides:
[ Top ]
$str_filename = 'file.dat'
[line 36]
eDDataFile::$str_filename
Name of the file to create
Type: mixed
Overrides:
[ Top ]
$str_filepath = null
[line 43]
eDDataFile::$str_filepath
Path to the location on the filesystem where to create the data file
Type: mixed
Overrides:
[ Top ]
$str_separator = ','
[line 50]
eDDataFile::$str_separator
Character or string to be used to separate record fields
Type: mixed
Overrides:
[ Top ]
$traceMode = 'log'
[line 87]
eDDataFile::$traceMode
Trace mode, either screen or log
Type: mixed
Overrides:
[ Top ]
Class Methods
eDDataFile
eDDataFile eDDataFile(
mixed
$arr_records, [mixed
$arr_filters = null], [mixed
$str_filename = 'file.dat'], [mixed
$str_filepath = null], [mixed
$str_separator = ','], [mixed
$str_endofline = "\n"], [mixed
$traceEnabled = false], [string
$mode = 'extended'], [mixed
$int_fp = null], string
$dbName, array
$arr_from, array
$arr_select, array
$arr_where, string
$orderBy, boolean
$debug)
[line 103]
Class Constructor
Today the constructor launches the construction and the execution of the query (extended mode) but this can be moved away to stay under the responsability of the script calling eDDataFile
Parameters:
- string $dbName - name of the db against which the query will be launched
- array $arr_from - array containing the list of table to query, ex: array('system', 'employee')
- array $arr_select - array containing the list of fields to retrieve, ex: array('systemid', 'employeeid')
- array $arr_where - array describing the where clause, ex: array('systemid' => "'1'") or array("systemid > '1'" => '') for clause not based on = operators
- string $mode - only build the query in normal mode, build and run the query in extended mode
- string $orderBy - name of the field(s) to use to order the results of the query
- boolean $debug - enter function in debug mode (enables outputs) or not
[ Top ]
createFile
void createFile(
[mixed
$str_filename = 'file.dat'], [mixed
$str_filepath = null])
[line 195]
Method :: createFile
Create the data file
{ Description }
Change Log
Tags:
- since - eDDataFile v1.0
Parameters:
[ Top ]
fillData
void fillData(
mixed
$arr_records, mixed
$int_fp, [mixed
$str_separator = ','], [mixed
$str_endofline = "\n"])
[line 219]
Build the query
Change Log 14/08/2003 BPO First version xx/xx/xxxx WHO SFxx#000000 Title
Parameters:
[ Top ]
filterRecords
void filterRecords(
mixed
$arr_records, mixed
$arr_filters)
[line 166]
Method :: filterRecords
Filter an array of records based on a filter definition array
Tags:
- since - eDDataFile v1.0
Parameters:
[ Top ]
getData
void getData(
)
[line 267]
Method :: getData()
Returns the array of data being written to the data file
Change Log 14/08/2003 BPO First version xx/xx/xxxx WHO SFxx#000000 Title
Parameters:
[ Top ]