Skip to content
Snippets Groups Projects
Commit 9ec4ac59 authored by Jared Hancock's avatar Jared Hancock
Browse files

orm: oops: Fix crash compiling delete model stmt

parent b2c85f3e
No related branches found
No related tags found
No related merge requests found
......@@ -1682,7 +1682,8 @@ class MySqlCompiler extends SqlCompiler {
function compileDelete($model) {
$table = $model::$meta['table'];
$where = ' WHERE '.implode(' AND ', $this->compileConstraints($model->pk));
$where = ' WHERE '.implode(' AND ',
$this->compileConstraints(array(new Q($model->pk)), $model));
$sql = 'DELETE FROM '.$this->quote($table).$where.' LIMIT 1';
return new MySqlExecutor($sql, $this->params);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment