POO list records [closed]

2

Hey guys, which way is it better to list bank records? The first is the structured way and the second is the object oriented is not it? Thanks.

First:

$sql = $usuario -> listar();

foreach($sql AS $registro)
{
    echo $registro['nome'];
}

Second:

$sql = $usuario -> listar();

foreach($sql AS $registro)
{
    $usuario -> setNome($registro['nome']);
    echo $usuario -> getNome();
}
    
asked by anonymous 31.03.2017 / 19:37

0 answers