mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
removing variables that are unnecessarily used
This commit is contained in:
parent
0ada30f3bc
commit
b92b7c2d2d
1 changed files with 8 additions and 4 deletions
|
@ -2482,7 +2482,7 @@ class Model extends Object implements CakeEventListener {
|
||||||
*/
|
*/
|
||||||
protected function _deleteLinks($id) {
|
protected function _deleteLinks($id) {
|
||||||
foreach ($this->hasAndBelongsToMany as $data) {
|
foreach ($this->hasAndBelongsToMany as $data) {
|
||||||
list($plugin, $joinModel) = pluginSplit($data['with']);
|
list(, $joinModel) = pluginSplit($data['with']);
|
||||||
$records = $this->{$joinModel}->find('all', array(
|
$records = $this->{$joinModel}->find('all', array(
|
||||||
'conditions' => array($this->{$joinModel}->escapeField($data['foreignKey']) => $id),
|
'conditions' => array($this->{$joinModel}->escapeField($data['foreignKey']) => $id),
|
||||||
'fields' => $this->{$joinModel}->primaryKey,
|
'fields' => $this->{$joinModel}->primaryKey,
|
||||||
|
@ -2581,9 +2581,13 @@ class Model extends Object implements CakeEventListener {
|
||||||
if ($id === false) {
|
if ($id === false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$conditions = array($this->alias . '.' . $this->primaryKey => $id);
|
return (bool)$this->find('count', array(
|
||||||
$query = array('conditions' => $conditions, 'recursive' => -1, 'callbacks' => false);
|
'conditions' => array(
|
||||||
return $this->find('count', $query) > 0;
|
$this->alias . '.' . $this->primaryKey => $id
|
||||||
|
),
|
||||||
|
'recursive' => -1,
|
||||||
|
'callbacks' => false
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue