Created
August 13, 2010 20:41
-
-
Save thiagosf/523517 to your computer and use it in GitHub Desktop.
class Cidade extends AppModel
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
<?php | |
/** | |
* | |
*/ | |
class Cidade extends AppModel | |
{ | |
function getCidade ($id_cidade) { | |
$cidades = $this->find('list', array( | |
'conditions' => array('codigo = '.$id_cidade), | |
'fields' => 'cidade' | |
)); | |
if (!empty($cidades)) { | |
$cidades = array_values($cidades); | |
return $cidades[0]; | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment