/**
* @param integer $currentPage
* @return void
*/
public function indexAction($currentPage = 1)
{
$this->currentPage = (int) $currentPage;
if ($this->currentPage < 1) {
$this->currentPage = 1;
} elseif ($this->currentPage > $this->numberOfPages) {
$this->currentPage = $this->numberOfPages;
}
$itemsPerPage = (int) $this->configuration['itemsPerPage'];
$query = $this->objects->getQuery();
$query->setLimit($itemsPerPage);
if ($this->currentPage > 1) {
$query->setOffset((int) ($itemsPerPage * ($this->currentPage - 1)));
}
$modifiedObjects = $query->execute();
$this->view->assign('contentArguments', array($this->widgetConfiguration['as'] => $modifiedObjects));
$this->view->assign('configuration', $this->configuration);
$this->view->assign('pagination', $this->buildPagination());
}