Пример #1
0
 public function get($role, $module, $permission)
 {
     //overrides parent method get
     $where = array('role_id' => $role, 'module' => $module);
     $this->db->like('permission', '-' . $permission . '-');
     return parent::get($where);
 }
Пример #2
0
 public function user_auth($email, $pass)
 {
     $this->db->join('roles', "roles.role_id = users.role_id");
     $this->db->where(array('pass' => md5($pass), 'status' => 'active', 'username' => $email));
     $this->db->or_where(array('email' => $email));
     return parent::get(array('pass' => md5($pass), 'status' => 'active'));
 }
Пример #3
0
 public function get($where, $like)
 {
     //overrides parent method get
     if ($where && !is_array($where)) {
         $where = array('empty_id' => $where);
     }
     // when where is not false and only a single id
     return parent::get($where, $like);
 }
Пример #4
0
 public function get($where)
 {
     //overrides parent method get
     if ($where && !is_array($where)) {
         $where = array('node_id' => $where);
     }
     // when where is not false and only a single id
     $this->db->join('nodes', 'nodes.node_id = replies.reply_id');
     return parent::get($where);
 }
Пример #5
0
 public function get($where = array(), $like = false, $order = false, $group = false, $select = false, $limit = false)
 {
     //overrides parent method get
     if ($where && !is_array($where)) {
         $where = array('node_id' => $where);
     }
     // when where is not false and only a single id
     $this->db->join('nodes', 'nodes.node_id = menus.menu_id');
     return parent::get(array_merge(array('module' => 'menu'), $where), $like, $order, $group, $select, $limit);
 }
Пример #6
0
 public function get($where = false, $like = false, $order = false, $group = false, $select = false)
 {
     //overrides parent method get
     if ($where && !is_array($where)) {
         $where = array('nodes.node_id' => $where);
     }
     // when where is not false and only a single id
     $this->db->join('nodes', 'nodes.node_id = pages.page_id');
     $this->db->join('users', 'users.user_id = nodes.user_id');
     return parent::get(array_merge(array('module' => 'page'), $where), $like, $order, $group, $select ? $select : 'users.*, nodes.* ,pages.*');
 }
Пример #7
0
 public function get($where = false, $like = false)
 {
     //overrides parent method get
     if (!$where) {
         return parent::get(array('primary' => 1), $like);
     }
     if (!is_array($where)) {
         return parent::get(array('primary' => $where), $like);
     }
     return parent::get($where, $like);
 }
Пример #8
0
 public function get($where = false, $like = false, $order = false, $group = false, $select = false)
 {
     //overrides parent method get
     if ($where && !is_array($where)) {
         $where = array('nodes.node_id' => $where);
     }
     // when where is not false and only a single id
     $this->db->join('nodes', 'nodes.node_id = posts.post_id');
     $this->db->join('users', 'users.user_id = nodes.user_id');
     $this->db->join('post_types', 'post_types.post_type_id = posts.post_type_id');
     return parent::get($where, $like, $order, $group, $select ? $select : "users.*, post_types.*, posts.*, nodes.*");
 }