Guest User

Untitled

a guest
Jun 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <?php defined('SYSPATH') OR die('No direct access allowed.');
  2.  
  3. class Auth_Model extends Model {
  4.  
  5. public static function factory()
  6. {
  7. return new Auth_Model();
  8. }
  9.  
  10. public function get_rules()
  11. {
  12. return DB::query('SELECT * FROM rules')->execute();
  13. }
  14.  
  15. public function get_roles()
  16. {
  17. return array_map(function($in) {
  18. if(string::contains($in['parent'], ','))
  19. $in['parent'] = explode(',', $in['parent']);
  20. return $in;
  21. }, DB::query('SELECT * FROM roles')->execute()->as_array(TRUE));
  22. }
  23.  
  24. }
Add Comment
Please, Sign In to add comment