public function listAction()
 {
     $testModel = new Test();
     $result = $testModel->getSql()->select()->where(array('active' => 1));
     $adapter = new PaginatorDbAdapter($result, $testModel->getAdapter());
     $paginator = new Paginator($adapter);
     $currentPage = $this->params('page', 1);
     $paginator->setCurrentPageNumber($currentPage);
     $paginator->setItemCountPerPage(10);
     $acl = $this->serviceLocator->get('acl');
     return array('tests' => $paginator, 'acl' => $acl, 'page' => $currentPage);
 }
Example #2
0
 public function store($data)
 {
     $model = new Test();
     $data['definition'] = $this->services->get('cipher')->encrypt($data['definition']);
     return $model->insert($data);
 }