Permalink
Browse files

removing variables that are unnecessarily used

  • Loading branch information...
1 parent 0ada30f commit b92b7c2d2d9d086810373ddc4c106c3876ae23f4 @dogmatic69 dogmatic69 committed Dec 5, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/Cake/Model/Model.php
View
@@ -2482,7 +2482,7 @@ protected function _deleteDependent($id, $cascade) {
*/
protected function _deleteLinks($id) {
foreach ($this->hasAndBelongsToMany as $data) {
- list($plugin, $joinModel) = pluginSplit($data['with']);
+ list(, $joinModel) = pluginSplit($data['with']);
$records = $this->{$joinModel}->find('all', array(
'conditions' => array($this->{$joinModel}->escapeField($data['foreignKey']) => $id),
'fields' => $this->{$joinModel}->primaryKey,
@@ -2581,9 +2581,13 @@ public function exists($id = null) {
if ($id === false) {
return false;
}
- $conditions = array($this->alias . '.' . $this->primaryKey => $id);
- $query = array('conditions' => $conditions, 'recursive' => -1, 'callbacks' => false);
- return $this->find('count', $query) > 0;
+ return (bool)$this->find('count', array(
+ 'conditions' => array(
+ $this->alias . '.' . $this->primaryKey => $id
+ ),
+ 'recursive' => -1,
+ 'callbacks' => false
+ ));
}
/**

0 comments on commit b92b7c2

Please sign in to comment.