Browse files

Add a default value to the provided exists() code

If there is no default value, errors are thrown when code expecting to use the original exists() use it without a value.
  • Loading branch information...
1 parent f431bf0 commit f113eaba1aab4a9ef3d198f091d3d70d1b74405e @cincodenada cincodenada committed Mar 7, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1
@@ -77,7 +77,7 @@ The SoftDelete behavior allows you to keep records on database and do not show t
Since "exists" method in Model disable callbacks you may experience problems using it. To avoid these problems you can use the "existsAndNotDeleted" method from the behavior and we provide the following code to be put into AppModel to make this transparent:
- public function exists($id) {
+ public function exists($id = null) {
if ($this->Behaviors->attached('SoftDelete')) {
return $this->existsAndNotDeleted($id);
} else {

0 comments on commit f113eab

Please sign in to comment.