Migration::setRowValuesOnTable
Sets the values for multiple rows on a database table by the ID column.
Useful when fields have been removed from the class' `$db` property, and therefore are no longer accessible through the ORM. Returns false if the table or any of the rows do not exist. Returns true if the SQL query was executed.
Signature
public function setRowValuesOnTable(string
$table,
array
$values,
[int|null
$id = NULL,
[boolean
$insert = false]] )
Parameters
$table
— string$values
— array- Ex: array('FieldName' => value)
$id
— object- Note: Null only works here if $insert = true.
$insert
— boolean- Allows insertion of a new record if the ID provided is null or doesn't exist.
NOTE: If an "ID" field is passed, that ID value will be retained.
Returns
- bool
- Will return true if anything was changed, false otherwise.
Line | Task |
---|---|
222 | This should maybe throw an exception instead. |