Quantcast
Channel: PHP Website Development » PH
Viewing all articles
Browse latest Browse all 11

Where will you implement pagination in SOA application in PH

$
0
0

I’ve a application which Services to retrieve object from Doctrine 2 repositories.
I’m used to Zend_Paginator, and, well I know that there is adapter for it.
However, I’m wondering where and how should I implement system.
let’s say I’ve such methods:
public function getLatestArticles();
public function getReviewedArticles();
public function getSubmitedArticles();Then, in use, in my controller, I’ll have :
public function listAction()
{
$which = $this->_getParam(‘which’, ‘latest’);
switch($which)
{
case ‘latest’:
$articles = $service->getLatestArticles();
}
}But let’s say now, I’d like to have a pagination.
How would you implement this?
Note that for doing pagination I need to do two things, get the COUNT() then, slice the result. I can easily slice result by adding page or range arguments in my service method, but how will I count?
I’m stuck, as I can’t find the best way to do, maybe my system is not adapted and I’m looking at the right thing.
Any feedbacks & help will be much appreciated.
……………………………………..

I think you’re looking for this answer: Doctrine2 large collections


Viewing all articles
Browse latest Browse all 11

Trending Articles