diff --git a/include/class.orm.php b/include/class.orm.php index 88360580853d8ad350ba6c335399898cdd4e2d5c..664b506f1c0fde2981c603de12d486af7c2c54ff 100644 --- a/include/class.orm.php +++ b/include/class.orm.php @@ -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); }