Permalink
Browse files

Merge pull request #45 from webino/hotfix/33

Added ZendDb role adapter option, Fixes #33
  • Loading branch information...
2 parents 34cb9e9 + 12f659a commit cddd20678918f8aff7e9784cea6f279e6a8d1b25 @bjyoungblood committed Dec 14, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/BjyAuthorize/Provider/Role/ZendDb.php
@@ -12,6 +12,7 @@ class ZendDb implements ProviderInterface
{
protected $sm;
+ protected $adapterName = 'Zend\Db\Adapter\Adapter';
protected $tableName = 'user_role';
protected $roleIdFieldName = 'role_id';
protected $parentRoleFieldName = 'parent';
@@ -20,6 +21,10 @@ public function __construct($options, $serviceManager)
{
$this->sm = $serviceManager;
+ if (isset($options['adapter'])) {
+ $this->adapterName = $options['adapter'];
+ }
+
if (isset($options['table'])) {
$this->tableName = $options['table'];
}
@@ -35,7 +40,7 @@ public function __construct($options, $serviceManager)
public function getRoles()
{
- $tableGateway = new TableGateway($this->tableName, $this->sm->get('Zend\Db\Adapter\Adapter'));
+ $tableGateway = new TableGateway($this->tableName, $this->sm->get($this->adapterName));
$sql = new Select;
$sql->from($this->tableName);

0 comments on commit cddd206

Please sign in to comment.