Run driver specific SQL to enable foreign key checks.
public enableForeignKeys ( ) : void | ||
Результат | void |
/** * Executes list of quries in one transaction. * * @param \Cake\Database\Connection $db Connection to run the SQL queries on. * @param array $queries List of SQL statements. * @return void */ protected function _execute($db, $queries = null) { $logQueries = $db->logQueries(); if ($logQueries) { $db->logQueries(false); } $db->transactional(function ($db) use($queries) { $db->disableForeignKeys(); foreach ($queries as $query) { $this->_io->out('.', 0); $db->execute($query)->closeCursor(); } $db->enableForeignKeys(); }); if ($logQueries) { $db->logQueries(true); } }