Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Problem with paged Doctrine in using Doctrine Query -> offset to the query page
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Nixs  
View profile   Translate to Translated (View Original)
 More options 2 July, 21:58
From: Nixs <acron...@gmail.com>
Date: Thu, 2 Jul 2009 13:58:23 -0700 (PDT)
Local: Thurs 2 July 2009 21:58
Subject: Problem with paged Doctrine in using Doctrine Query -> offset to the query page
hello. I'm in a weird situation. I need to paginate
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!

here's the code:

public static function buscarProductos($tiendaId,$cantResultados =
10,$offSet){

                $query= Doctrine_Query::create()
                ->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);

                return $query;

Any idea? now, thanks


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Szabolcs Heilig  
View profile   Translate to Translated (View Original)
 More options 2 July, 22:14
From: Szabolcs Heilig <szabolcs.hei...@gmail.com>
Date: Thu, 2 Jul 2009 23:14:18 +0200
Local: Thurs 2 July 2009 22:14
Subject: Re: [doctrine-user] Problem with paged Doctrine in using Doctrine Query -> offset to the query page

Hello,

To get closer tho know what does Doctrine in that case,
(your offset is out of the bound) check the generated SQL with:

echo $query->getSql();

You can check the generated SQL with that step.

2009/7/2 Nixs <acron...@gmail.com>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nixs  
View profile   Translate to Translated (View Original)
 More options 3 July, 00:22
From: Nixs <acron...@gmail.com>
Date: Thu, 2 Jul 2009 16:22:55 -0700 (PDT)
Local: Fri 3 July 2009 00:22
Subject: Re: Problem with paged Doctrine in using Doctrine Query -> offset to the query page
SQL queries

   1. SELECT DISTINCT p2.id FROM producto p2 LEFT JOIN
imagenes_producto i2 ON p2.id = i2.producto_id LEFT JOIN categoria c2
ON p2.categoria_id = c2.id WHERE p2.tienda_id = 1 ORDER BY p2.id desc
LIMIT 4 OFFSET 13

2. SELECT p.id AS p__id, p.precio AS p__precio, p.descripcion AS
p__descripcion, p.titulo AS p__titulo, p.moneda AS p__moneda, i.id AS
i__id, c.id AS c__id, c.nombre AS c__nombre FROM producto p LEFT JOIN
imagenes_producto i ON p.id = i.producto_id LEFT JOIN categoria c ON
p.categoria_id = c.id WHERE p.tienda_id = 1 ORDER BY p.id desc

I use sfDoctrinePager exactly the same problem occurs

On 2 jul, 18:14, Szabolcs Heilig <szabolcs.hei...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nixs  
View profile   Translate to Translated (View Original)
 More options 3 July, 00:35
From: Nixs <acron...@gmail.com>
Date: Thu, 2 Jul 2009 16:35:28 -0700 (PDT)
Local: Fri 3 July 2009 00:35
Subject: Re: Problem with paged Doctrine in using Doctrine Query -> offset to the query page

Consultation with a simple offset me functioning correctly,
sfDoctrinePager.
The problem is in this query specifies

On 2 jul, 20:22, Nixs <acron...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google