diff options
author | Chris Cornutt <enygma@phpdeveloper.org> | 2015-01-25 16:47:03 -0600 |
---|---|---|
committer | Chris Cornutt <enygma@phpdeveloper.org> | 2015-01-25 16:47:03 -0600 |
commit | 854a0d042dd1e4e40ef69e59638fa490d913ac29 (patch) | |
tree | a504c9ced667ac3bb45b8c7b424de676197ea4a2 | |
parent | ed01f9184a1d0ee11d3dd0e42244ebb737e925e8 (diff) | |
download | gatekeeper-854a0d042dd1e4e40ef69e59638fa490d913ac29.zip gatekeeper-854a0d042dd1e4e40ef69e59638fa490d913ac29.tar.gz gatekeeper-854a0d042dd1e4e40ef69e59638fa490d913ac29.tar.bz2 |
updating user group collection to add new model instances to the collection (was just saving and not adding)
-rw-r--r-- | src/Psecio/Gatekeeper/UserGroupCollection.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Psecio/Gatekeeper/UserGroupCollection.php b/src/Psecio/Gatekeeper/UserGroupCollection.php index 036aee7..6db6195 100644 --- a/src/Psecio/Gatekeeper/UserGroupCollection.php +++ b/src/Psecio/Gatekeeper/UserGroupCollection.php @@ -50,7 +50,9 @@ class UserGroupCollection extends \Psecio\Gatekeeper\Collection\Mysql $this->getDb(), array('groupId' => $results[0]['id'], 'userId' => $model->id) ); - $this->getDb()->save($model); + if ($this->getDb()->save($model) === true) { + $this->add($model); + } } } } |