summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Cornutt <enygma@phpdeveloper.org>2015-07-17 22:50:18 -0500
committerChris Cornutt <enygma@phpdeveloper.org>2015-07-17 22:50:18 -0500
commitcb527fe0df3893d6a11375c371caae70862ea7b5 (patch)
treeb2a058832a667efd09d3834dc16fd50c4aa1c9f1
parent9f264150c76ccb0a68a731cfe35b1bc65544c781 (diff)
downloadgatekeeper-cb527fe0df3893d6a11375c371caae70862ea7b5.zip
gatekeeper-cb527fe0df3893d6a11375c371caae70862ea7b5.tar.gz
gatekeeper-cb527fe0df3893d6a11375c371caae70862ea7b5.tar.bz2
return a false instead of throwing an exception when record is not found
-rw-r--r--src/Psecio/Gatekeeper/Handler/FindBy.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Psecio/Gatekeeper/Handler/FindBy.php b/src/Psecio/Gatekeeper/Handler/FindBy.php
index 4327b12..a2504e8 100644
--- a/src/Psecio/Gatekeeper/Handler/FindBy.php
+++ b/src/Psecio/Gatekeeper/Handler/FindBy.php
@@ -66,8 +66,7 @@ class FindBy extends \Psecio\Gatekeeper\Handler
$instance = $this->getDb()->find($instance, $data);
if ($instance->id === null) {
- $exception = '\\Psecio\\Gatekeeper\\Exception\\'.$model.'NotFoundException';
- throw new $exception($model.' could not be found for criteria');
+ return false;
}
return $instance;