Copies all values from one table to another. Will override any existing values with matching ID's.
Signature
public function copyTable(string
$fromTable,
string
$toTable,
[array
$fieldMapping = NULL,
[boolean
$purgeDest = false,
[mixed|null
$where = NULL]]] )
Parameters
$fromTable
—
string
Name of SOURCE table to copy values from.
$toTable
—
string
Name of DESTINATION table to copy values to.
$fieldMapping
—
array
Array of fields to copy (and ONLY these fields). Can also specify key => value pairs to map between old/new names (instead of just values). Note: Leave empty (or pass null) to automatically assume ALL fields from source table (including ID).
$purgeDest
—
boolean
Ensures all data in the DESTINATION table matches the source.
$where
—
object
An optional filter passed directly to ->setWhere() method on SQLSelect.