Created
October 31, 2016 18:14
Star
You must be signed in to star a gist
Série RestServer - Método GetById
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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