function getListJSON($idplato) { $sql = "select * from {$this->tabla} where idplato=:idplato"; $param['idplato'] = $idplato; $this->bd->setConsulta($sql, $param); $r = "[ "; while ($fila = $this->bd->getFila()) { $foto = new Foto(); $foto->set($fila); $r .= $foto->getJSON() . ","; } $r = substr($r, 0, -1) . "]"; return $r; }