Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7770693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:28:13+00:00 2026-06-01T16:28:13+00:00

Starting with version 2.2 Doctrine has Paginator . There is only one example in

  • 0

Starting with version 2.2 Doctrine has Paginator. There is only one example in the documentation:

<?php
use Doctrine\ORM\Tools\Pagination\Paginator;

$dql = "SELECT p, c FROM BlogPost p JOIN p.comments c";
$query = $entityManager->createQuery($dql)
                       ->setFirstResult(0)
                       ->setMaxResults(100);

$paginator = new Paginator($query, $fetchJoin = true);

$c = count($paginator);
foreach ($paginator as $post) {
    echo $post->getHeadline() . "\n";
}

There is nothing new in this class since the whole process described in the documentation can be done with $query->getResult().

I know there are some bundles about pagination but I don’t want to install third party bundles for such trivial issues. On the other hand, I cannot find anything about pagination of doctrine2. There should be some useful methods of the class. Where can I find them? If there are not then what is the point of the whole class?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:28:15+00:00Added an answer on June 1, 2026 at 4:28 pm

    Doctrine’s paginator is not Symfony aware — it’s low-level and Doctrine specific.

    On the other hand, if you install a 3rd party bundle, you’ll get pagination adapters for Doctrine ORM & ODM, Propel, plain arrays, etc. You’ll also get Symfony integration and view helpers. At least WhiteOctoberPagerfantaBundle that I use does all these.

    So, unless you’re going with Doctrine only, I suggest you reconsider your position about a 3rd party bundle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just now starting to use version control and my head is spinning!
Starting with version 5.3, PHP supports late binding for static methods. While it's an
I'm currently starting to use git for my version control system, however I do
Starting with Scala version 2.9 there exists a handy converter to convert from java.util.List
I am starting to develop Android applications. Which version of Eclipse should I use?
Quote from hib official docs: Starting with version 3.0.1, Hibernate added the SessionFactory.getCurrentSession() method.
Starting a new big C multiplatform project, what rules should one follow to avoid
I know that there are no fixed rules about software version control but I
I started by creating a universal window based app. Starting with the iPhone version
I just starting looking at the Python version of Mechanize today. I took most

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.