Db::forceWrite
Usage
void Db::forceWrite([ bool $always = false ])Description
Force all SQL queries to the master / write database connection, and never connect to the read-only connection.Parameters
Parameter | Required | Type | Description |
---|---|---|---|
$always | No | bool | Whether or not to always force all SQL queries to the master / write database for the duration of the request. |
Examples
Force Write
db->beginTransaction();
$this->db->forceWrite();
// Execute other inserts and updates
// Commit transaction, and force write is now off
$this->db->commit();