Skip to content

Instantly share code, notes, and snippets.

Created October 31, 2016 18:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/8f91f8a8881e591981c5dc5c2ab11059 to your computer and use it in GitHub Desktop.
Série RestServer - Método GetById
/*
* Método que irá listar todos os usuários
* recebe como parâmetro os campos a serem retornados
*/
public function GetById($id, $fields = '*')
{
if ($id <= 0) {
return array();
}
$this->db->select($fields)
->from('usuarios')
->where('id',$id)
->order_by('nome','ASC');
return $this->db->get()->result_array();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment