mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #10739 from bancer/unnecessary-joins-delete-all
Takes into account the current recursive value in deleteAll().
This commit is contained in:
commit
77b7ccf3ad
1 changed files with 2 additions and 2 deletions
|
@ -2832,12 +2832,12 @@ class Model extends CakeObject implements CakeEventListener {
|
|||
if (!$cascade && !$callbacks) {
|
||||
return $db->delete($this, $conditions);
|
||||
}
|
||||
|
||||
$recursive = min($this->recursive, 0);
|
||||
$ids = $this->find('all', array_merge(array(
|
||||
'fields' => "{$this->alias}.{$this->primaryKey}",
|
||||
'order' => false,
|
||||
'group' => "{$this->alias}.{$this->primaryKey}",
|
||||
'recursive' => 0), compact('conditions'))
|
||||
'recursive' => $recursive), compact('conditions'))
|
||||
);
|
||||
|
||||
if ($ids === false || $ids === null) {
|
||||
|
|
Loading…
Reference in a new issue