get_where() public method

Allows the where clause, limit and offset to be added directly
public get_where ( string $table = '', string $where = NULL, integer $limit = NULL, integer $offset = NULL ) : CI_DB_result
$table string
$where string
$limit integer
$offset integer
return CI_DB_result
 protected function is_unique($field, $value, $id)
 {
     $where = [$field => $value];
     if ($id) {
         $where[] = "id != {$id}";
     }
     return !$this->db->get_where($this->table, $where)->row_array();
 }
 public function get_by_id($id)
 {
     return $this->db->get_where($this->table, ['id' => $id])->row_array();
 }