| |
doctrine-user |
Hello, To get closer tho know what does Doctrine in that case, echo $query->getSql(); You can check the generated SQL with that step. 2009/7/2 Nixs <acron...@gmail.com> > hello. I'm in a weird situation. I need to paginate > here's the code: > public static function buscarProductos($tiendaId,$cantResultados = > $query= Doctrine_Query::create() > return $query;
(your offset is out of the bound) check the generated SQL with:
> and show 10 results per query does pagina.mi correctly.
> Then -> offset (10) in the query shows the following 10
> results.
> The question is what does it correctly. The problem is that when
> asks a page, for example the number 500, which is not logically
> There, instead of not returning anything, I devulve ALL!
> 10,$offSet){
> ->select
> ('p.id,ip.id,p.precio,p.descripcion,p.titulo,p.moneda,c.id,c.nombre')
> ->from('Producto p,p.ImagenesProducto ip,p.Categoria
> c')
> ->addWhere('p.tienda_id='.$tiendaId)
> ->orderBy('p.id desc')
> ->limit($cantResultados)
> ->offSet($offSet)
> ->execute(array(),Doctrine::HYDRATE_ARRAY);