Created
February 25, 2014 00:01
-
-
Save nclundsten/9199914 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Authorize\Provider; | |
use BjyAuthorize\Provider\Role\ProviderInterface; | |
use BjyAuthorize\Provider\Role\Config; | |
class RoleProvider extends AbstractDbProvider implements ProviderInterface | |
{ | |
protected $tableName = "group_roles"; | |
public function getRoles() | |
{ | |
$select = $this->getSelect(); | |
$rows = $this->select($select); | |
$rolesConfig = array(); | |
foreach ($rows as $row) { | |
//todo: custom hydrator for this | |
//todo: do something with the numeric check in config construct | |
$rolesConfig['role-'.$row['id']] = array( | |
'children' => array() //no inheritance | |
); | |
} | |
$config = new Config($rolesConfig); | |
var_dump($config); | |
return $config; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment