Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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);
return $config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment