Last active
September 18, 2015 19:56
-
-
Save blennocleofas/4af63d3ce086ed5ddb13 to your computer and use it in GitHub Desktop.
array_multi
This file contains hidden or 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
private function montarArray($consulta) | |
{ | |
if (count($consulta) < 1) { | |
return []; | |
} | |
$result = [ | |
'cliente_nome' => $consulta[0]['NOME'], | |
'cliente_cpf' => $consulta[0]['CPF'], | |
'registros' => [] | |
]; | |
foreach ($consulta as $resultado) { | |
$array = [ | |
'cartorio' => $resultado->cartorio->nome, | |
'cartorio_atribuicoes' => $resultado->cartorio->atribuicoes, | |
'cartorio_cidade' => "Goiânia", | |
'cartorio_uf' => "Goiás", | |
'cns_cartorio' => $resultado->cartorio->cns, | |
'id_cartorio' => $resultado->cartorio->id, | |
'matricula' => $resultado->NUMERO, | |
'vinculo' => (strlen($resultado->DATA_TRANSFERENCIA) > 0) ? 'Ex-proprietário(a)' : $resultado->VINCULO, | |
'tipo' => $resultado->TIPO | |
]; | |
array_push($result['registros'], $array); | |
} | |
return $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment