CSVImport
in package
Common CSV import actions.
Tags
Table of Contents
- importFileSQL() : string
- Return the insert SQL reading a CSV file for the specific file
- importTableSQL() : string
- Return the insert SQL reading a CSV file for the specific table
- updateTableSQL() : string
- getTableFilePath() : string
- Return the correct filepath for the table
- insertOnDuplicateSql() : string
- valueToSql() : string
- Returns a value to SQL format.
Methods
importFileSQL()
Return the insert SQL reading a CSV file for the specific file
public
static importFileSQL(string $table, string $filePath[, bool $update = false ]) : string
Parameters
- $table : string
- $filePath : string
- $update : bool = false
Return values
string —importTableSQL()
Return the insert SQL reading a CSV file for the specific table
public
static importTableSQL(string $table) : string
Parameters
- $table : string
Return values
string —updateTableSQL()
public
static updateTableSQL(string $table) : string
Parameters
- $table : string
Return values
string —getTableFilePath()
Return the correct filepath for the table
protected
static getTableFilePath(string $table) : string
Parameters
- $table : string
Return values
string —insertOnDuplicateSql()
private
static insertOnDuplicateSql(string $sql, Csv $csv) : string
Parameters
- $sql : string
- $csv : Csv
Return values
string —valueToSql()
Returns a value to SQL format.
private
static valueToSql(DataBase &$dataBase, string $value) : string
Parameters
- $dataBase : DataBase
- $value : string