From 90a77f6ce5b6b6b39c9d643a79f43ec99143c383 Mon Sep 17 00:00:00 2001 From: James Tancock Date: Sun, 16 Aug 2015 19:06:12 +0100 Subject: [PATCH] Alter model exists to consider useTable --- lib/Cake/Model/Model.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index bfce2dd41c2..124bb394ab3 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -2895,6 +2895,10 @@ public function exists($id = null) { return false; } + if ($this->useTable === false) { + return true; + } + return (bool)$this->find('count', array( 'conditions' => array( $this->alias . '.' . $this->primaryKey => $id