diff options
author | Chris Cornutt <enygma@phpdeveloper.org> | 2015-06-04 19:57:39 -0500 |
---|---|---|
committer | Chris Cornutt <enygma@phpdeveloper.org> | 2015-06-04 19:57:39 -0500 |
commit | 0c04ffbb487a2f93fc3b5938a1804c54f659c00f (patch) | |
tree | 8d5578a230df62cd230bc0ef0cd4c8774f314fa8 | |
parent | 4e2c66b7dd4427f8971bd0ddb46c967a4af01a77 (diff) | |
download | gatekeeper-0c04ffbb487a2f93fc3b5938a1804c54f659c00f.zip gatekeeper-0c04ffbb487a2f93fc3b5938a1804c54f659c00f.tar.gz gatekeeper-0c04ffbb487a2f93fc3b5938a1804c54f659c00f.tar.bz2 |
Fixing issue with find by for multiple results
-rw-r--r-- | src/Psecio/Gatekeeper/DataSource/Mysql.php | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Psecio/Gatekeeper/DataSource/Mysql.php b/src/Psecio/Gatekeeper/DataSource/Mysql.php index 7f0169b..22d0622 100644 --- a/src/Psecio/Gatekeeper/DataSource/Mysql.php +++ b/src/Psecio/Gatekeeper/DataSource/Mysql.php @@ -207,11 +207,10 @@ class Mysql extends \Psecio\Gatekeeper\DataSource } $result = $this->fetch($sql, $where); - if ($result !== false && count($result) == 1 && $multiple === false) { $model->load($result[0]); return $model; - } elseif (count($result) > 1){ + } elseif (count($result) > 1 || $multiple === true){ // Make a collection instead $modelClass = get_class($model); $collectionNs = str_replace('Model', 'Collection', $modelClass); |