Guest User

Untitled

a guest
Jul 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. class Initialize_Model extends Model {
  2.  
  3. public function initialize_roles()
  4. {
  5. foreach(Role_Model::$roles as $name => $description)
  6. {
  7. if(db::build()->select('id')->where('name', '=', $name)->count_records('roles') == 0)
  8. {
  9. $status = db::build()->insert('roles', array('name' => $name, 'description' => $description))->execute();
  10. }
  11. }
  12. }
  13. }
Add Comment
Please, Sign In to add comment