Hello everyone,

I'm using zend paginator to return DB-Results back to model and then
to controller like this.

    protected function paginate($select, $items, $page)
    {
        $adapter = new \Zend_Paginator_Adapter_DbTableSelect($select);
        $count = clone $select;
        $count->reset(\Zend_Db_Select::COLUMNS);
        $count->reset(\Zend_Db_Select::FROM);
        $count->reset(\Zend_Db_Select::ORDER);
        $count->from($this->_name, new \Zend_Db_Expr('COUNT(*) AS
`zend_paginator_row_count`'));
        $adapter->setRowCount($count);

        $paginator = new \Zend_Paginator($adapter);
        $paginator->setItemCountPerPage($items)
                ->setCurrentPageNumber((int) $page);
        return $paginator;
    }


The problem I'm facing is, that it is impossible to add custom fields
to $paginator results. I'm getting an exception "specified column
'foo' not in row". How do one handle this situation?

Thanks for help!

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


Reply via email to