Hi Roy, I don't think the paginator as-is is a good fit for this use-case: what you want here is different custom queries, which you can then simplify into an iterator later on.
Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 7 October 2014 03:02, Roy Epperson <[email protected]> wrote: > I'm using Paginator for displaying large sets of object on a webpage > just fine use a $pageSize and $currentPage as selection of which page to > display. The setup is: > $paginator > ->getQuery() > ->setFirstResult($pageSize * ($currentPage - 1)) > ->setMaxResults(min($totalTopics, $pageSize)); > > I have not done an exhaustive look other than looking Paginator class. My > question is there a Paginator method or supporting class that would return > the first (or possbile last) object for each page of the n-pages of the > selected object set? I would like then display some attribute of that > object as the visual indicator for a page index. > > Right now for example, I am display a navigation bar: 1 > 10 20 30 > > And would like to display for example: Alpha Doctor > Fred Woody > > Is there a way to only get the first element in the result set which is > offset by the $pageSize or better yet return the first element of each > $pageSize across the entire dataset of the basic query? > > TIA, > Roy > > -- > You received this message because you are subscribed to the Google Groups > "doctrine-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/doctrine-user. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
