Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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