Skip to content

Instantly share code, notes, and snippets.

@thiagosf
Created August 13, 2010 20:41
Show Gist options
  • Save thiagosf/523517 to your computer and use it in GitHub Desktop.
Save thiagosf/523517 to your computer and use it in GitHub Desktop.
class Cidade extends AppModel
<?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