public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $temp = new Estado($info[self::ID]);
         $temp->nome = $info[self::NOME];
         $temp->uf = $info[self::UF];
         $lP = new ListaPaises();
         $lP->condicoes('', $info[self::PAIS], ListaPaises::ID);
         if ($lP->getTotal() > 0) {
             $temp->setPais($lP->listar());
         }
         return $temp;
     }
 }
$iTCL->trocar("senha", $cl->senha);
$iTCL->trocar("pessoa", is_a($cl, "PessoaFisica") ? 'fisica' : 'juridica');
$iTCL->trocar("rg", $cl->rg);
$iTCL->trocar("cpf", $cl->cpf);
$iTCL->trocar("sexo", $cl->sexo);
$iTCL->trocar("atacadista", $cl->atacadista);
$iTCL->trocar("dataNasc", is_a($cl, "PessoaFisica") ? $cl->getDataNasc()->mostrar() : '');
$iTCL->trocar("razaoSocial", $cl->razaoSocial);
$iTCL->trocar("cnpj", $cl->cnpj);
$iTCL->trocar("atacadista", $cl->atacadista ? 1 : 0);
$iTCL->trocar("email", $cl->emailPrimario);
$iTCL->trocar("origemCadastro", $cl->origemCadastro);
$iTCL->condicao('condicao->POST', true);
$iTCL->condicao('condicao->alterar.Cliente', false);
//Endereço
$lPA = new ListaPaises();
$iTCL->createRepeticao("repetir->Pais");
while ($pA = $lPA->listar("ASC", ListaPaises::NOME)) {
    $iTCL->repetir();
    $iTCL->enterRepeticao()->trocar("id.Pais", $pA->getId());
    $iTCL->enterRepeticao()->trocar("nome.Pais", $pA->nome);
    if ($pA->getId() == $pais) {
        $iTCL->enterRepeticao()->trocar("selected.Pais", 'selected');
    }
}
$lE = new ListaEstados();
$iTCL->createRepeticao("repetir->Estado");
if (!empty($_GET['pais'])) {
    $lE->condicoes('', $_GET['pais'], ListaEstados::PAIS);
    if (isset($_GET['json'])) {
        $a = array();
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
Route::get('/', function () {
    return View::make('listas');
});
//Ruta para consultar todos los paises
Route::get('paises', function () {
    return ListaPaises::all()->toJson();
});
//Ruta en la cual retornamos los estados relaccionados con el id del pais
Route::POST('estados', function () {
    return ListaEstados::where('id_pais', '=', Input::get('pais'))->get();
});