Try something simple
//include class loader first //make sure this is correct $doctrine_root=APPLICATION_PATH. '/../library/Doctrine'; require_once $doctrine_root.'/Common/ClassLoader.php'; $classLoader = new \Doctrine\Common\ClassLoader('Doctrine',$doctrine_root); $classLoader->register(); user Doctrine\DoctrineExtensions\Paginate;
Then try resetting the code
$count = Paginate::getTotalQueryResults($query); // Step 1 // Step 2 and 3 $paginateQuery = Paginate::getPaginateQuery($query, $offset, $limitPerPage); $result = $paginateQuery->getResult();
let me know how it works
greetings :)
Note: I have not tested this code at my end
source share