Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php defined('SYSPATH') OR die('No direct access allowed.');
- class Auth_Model extends Model {
- public static function factory()
- {
- return new Auth_Model();
- }
- public function get_rules()
- {
- return DB::query('SELECT * FROM rules')->execute();
- }
- public function get_roles()
- {
- return array_map(function($in) {
- if(string::contains($in['parent'], ','))
- $in['parent'] = explode(',', $in['parent']);
- return $in;
- }, DB::query('SELECT * FROM roles')->execute()->as_array(TRUE));
- }
- }
Add Comment
Please, Sign In to add comment