Skip to content

Instantly share code, notes, and snippets.

@shadowhand
Created March 10, 2009 22:11
Show Gist options
  • Save shadowhand/77176 to your computer and use it in GitHub Desktop.
Save shadowhand/77176 to your computer and use it in GitHub Desktop.
<?php
public function find_all_by_role($role)
{
return $this
->join('roles_users', 'users.id', 'roles_users.user_id')
->join('roles', 'roles_users.role_id', 'roles.id')
->where('roles.name', $role)
->find_all();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment