Robert,

Thank you for the quick response (ili mozda da kazem hvala ;-)

The problem is that I already implemented the logic you suggested, but it
doesn't suit my current needs. Namely, I need to perform additional logic on
results before I use them in the paginator. For example, in this particular
case I need to set information about authors for every book in the
resultset:

... 
public function getBooks($currentPage) 
{ 
        $select = new Select; 
        $select->from('book'); 

        $resultSet = $this->select($select); 
        $resultSet->buffer(); 
        $resultSet->next(); 

        *foreach($resultSet as $book) {
                // Set author information for each book, e.g.
$book->setAuthor($someAuthor);
        }*

        $iteratorAdapter = new Iterator($resultSet); 
        $paginator = new Paginator($iteratorAdapter); 
        $paginator->setItemCountPerPage(10); 
        $paginator->setCurrentPageNumber($currentPage); 

        return $paginator; 
} 
... 

I'm not sure whether is it possible if the adapter is used directly in the
paginator.

Or maybe I missed something?



--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/ZF2-How-to-use-paginator-with-huge-number-of-records-tp4659675p4659677.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to