Is it possible to use the findParentRow()
method from within a Zend_Paginator Object? I'm trying some code that works fine on an object returned by fetchAll from a DB resultset and works fine. With the Zend_Paginator object it doesnt work though.
In my controller i have:
public function downloadedAction()
{
$images = new Model_ApplicationImages();
$paginator = $images->fetchPaginated();
$paginator->setCurrentPageNumber($this->_getParam('page'));
$this->view->paginator = $paginator;
}
In my model i have:
public function fetchPaginated()
{
$select = $this->select()
->from($this->_name)
->where('status = ?','approved')
->where('downloaded = ?','0');
$adapter = new Zend_Paginator_Adapter_DbSelect($select);
$paginator = new Zend_Paginator($adapter);
$paginator->setItemCountPerPage(10);
return $paginator;
}
In my view i have:
$this->partialLoop()->setObjectKey('paginator');
echo $this->partialLoop('admin/list-downloaded.phtml', $this->paginator);
and in the partial:
$this->paginator->findParentRow('Model_Application')->name
It appears though that the object key is not being used or not being set properly as within the partial var_dump($this->paginator)
is NULL
and the other values being passed from the paginator are there but under $this->key
and not $this->paginator->key
as they should be