function getLeftList()
 {
     $sql = "select p.*, f.* from producto p left join foto f on p.id = f.idproducto";
     $r = $this->bd->setConsulta($sql);
     $respuesta = array();
     while ($fila = $this->bd->getFila()) {
         $obj1 = new Producto();
         $obj1->set($fila);
         $obj2 = new Foto();
         $obj2->set($fila, 6);
         $objeto = new InnerProductoFoto($obj1, $obj2);
         $respuesta[] = $objeto;
     }
     return $respuesta;
 }
Ejemplo n.º 2
0
 function getList($condicion = "1=1", $parametro = array(), $orderby = "1")
 {
     $list = array();
     $sql = "select * from {$this->tabla} where {$condicion} order by {$orderby}";
     $r = $this->bd->setConsulta($sql, $parametro);
     if ($r) {
         while ($fila = $this->bd->getFila()) {
             $producto = new Producto();
             $producto->set($fila);
             $list[] = $producto;
         }
     } else {
         return null;
     }
     return $list;
 }