CSVImport
in package
Common CSV import actions.
Table of Contents
Methods
- getTableFilePath() : string
- Return the correct filepath for the table
- 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
- insertOnDuplicateSql() : string
- valueToSql() : string
- Returns a value to SQL format.
Methods
getTableFilePath()
Return the correct filepath for the table
public
static getTableFilePath(string $table) : string
Parameters
- $table : string
Return values
stringimportFileSQL()
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
stringimportTableSQL()
Return the insert SQL reading a CSV file for the specific table
public
static importTableSQL(string $table) : string
Parameters
- $table : string
Return values
stringupdateTableSQL()
public
static updateTableSQL(string $table) : string
Parameters
- $table : string
Return values
stringinsertOnDuplicateSql()
private
static insertOnDuplicateSql(string $sql, Csv $csv) : string
Parameters
- $sql : string
- $csv : Csv
Return values
stringvalueToSql()
Returns a value to SQL format.
private
static valueToSql(DataBase &$dataBase, string $value) : string
Parameters
- $dataBase : DataBase
- $value : string