Skip to content

Instantly share code, notes, and snippets.

@iammerrick
Created April 11, 2011 16:51
Show Gist options
  • Select an option

  • Save iammerrick/913849 to your computer and use it in GitHub Desktop.

Select an option

Save iammerrick/913849 to your computer and use it in GitHub Desktop.
By Role Name
<?php defined('SYSPATH') or die('No direct script access.');
class Model_Role extends Model_AutoModeler_ORM_Role{
public static function get_role_by_name($name)
{
$role = new self();
$role->load(DB::select()->where('name', '=', $name));
return $role;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment