Skip to content
This repository
Browse code

Merge pull request #45 from webino/hotfix/33

Added ZendDb role adapter option, Fixes #33
  • Loading branch information...
commit cddd20678918f8aff7e9784cea6f279e6a8d1b25 2 parents 34cb9e9 + 12f659a
Ben Youngblood authored December 14, 2012
7  src/BjyAuthorize/Provider/Role/ZendDb.php
@@ -12,6 +12,7 @@ class ZendDb implements ProviderInterface
12 12
 {
13 13
     protected $sm;
14 14
 
  15
+    protected $adapterName         = 'Zend\Db\Adapter\Adapter';
15 16
     protected $tableName           = 'user_role';
16 17
     protected $roleIdFieldName     = 'role_id';
17 18
     protected $parentRoleFieldName = 'parent';
@@ -20,6 +21,10 @@ public function __construct($options, $serviceManager)
20 21
     {
21 22
         $this->sm = $serviceManager;
22 23
 
  24
+        if (isset($options['adapter'])) {
  25
+            $this->adapterName = $options['adapter'];
  26
+        }
  27
+
23 28
         if (isset($options['table'])) {
24 29
             $this->tableName = $options['table'];
25 30
         }
@@ -35,7 +40,7 @@ public function __construct($options, $serviceManager)
35 40
 
36 41
     public function getRoles()
37 42
     {
38  
-        $tableGateway = new TableGateway($this->tableName, $this->sm->get('Zend\Db\Adapter\Adapter'));
  43
+        $tableGateway = new TableGateway($this->tableName, $this->sm->get($this->adapterName));
39 44
 
40 45
         $sql = new Select;
41 46
         $sql->from($this->tableName);

0 notes on commit cddd206

Please sign in to comment.
Something went wrong with that request. Please try again.