Created
October 31, 2016 18:14
-
-
Save anonymous/8f91f8a8881e591981c5dc5c2ab11059 to your computer and use it in GitHub Desktop.
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