1: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2:
3: class Roles_Model extends CI_Model {
4: /**
5: * Class Constructor
6: */
7: public function __construct() {
8: parent::__construct();
9: }
10:
11: /**
12: * Get the record id of a particular role.
13: *
14: * @param string $role_slug The selected role slug. Slugs are
15: * defined in the "application/config/constants.php" file.
16: * @return int Returns the database id of the roles record.
17: */
18: public function get_role_id($role_slug) {
19: return $this->db->get_where('ea_roles', array('slug' => $role_slug))->row()->id;
20: }
21: }
22:
23: /* End of file roles_model.php */
24: /* Location: ./application/models/roles_model.php */