示例#1
0
 /**
  * List Row action for this controller. Output a json list of contents
  *
  * @param array $columns corresponds to columns to be rendered.
  * @param array $matches
  * @validate $columns Fab\Vidi\Domain\Validator\ColumnsValidator
  * @validate $matches Fab\Vidi\Domain\Validator\MatchesValidator
  * @return void
  */
 public function listAction(array $columns = array(), $matches = array())
 {
     // Initialize some objects related to the query.
     $matcher = MatcherObjectFactory::getInstance()->getMatcher($matches);
     $order = OrderObjectFactory::getInstance()->getOrder();
     $pager = PagerObjectFactory::getInstance()->getPager();
     // Fetch objects via the Content Service.
     $contentService = $this->getContentService()->findBy($matcher, $order, $pager->getLimit(), $pager->getOffset());
     $pager->setCount($contentService->getNumberOfObjects());
     // Assign values.
     $this->view->assign('columns', $columns);
     $this->view->assign('objects', $contentService->getObjects());
     $this->view->assign('numberOfObjects', $contentService->getNumberOfObjects());
     $this->view->assign('pager', $pager);
     $this->view->assign('response', $this->response);
 }
示例#2
0
 /**
  * List Row action for this controller. Output a json list of contents
  *
  * @param array $columns corresponds to columns to be rendered.
  * @param array $matches
  * @validate $columns Fab\Vidi\Domain\Validator\ColumnsValidator
  * @validate $matches Fab\Vidi\Domain\Validator\MatchesValidator
  * @return void
  */
 public function listAction(array $columns = array(), $matches = array())
 {
     // Initialize some objects related to the query.
     $matcher = MatcherObjectFactory::getInstance()->getMatcher($matches);
     $order = OrderObjectFactory::getInstance()->getOrder();
     $pager = PagerObjectFactory::getInstance()->getPager();
     // If we are given a list of uids to export, do not use a limit because we want them all.
     $inCriteria = $matcher->getInCriteria();
     $limit = empty($inCriteria) ? $pager->getLimit() : NULL;
     // Fetch objects via the Content Service.
     $contentService = $this->getContentService()->findBy($matcher, $order, $limit, $pager->getOffset());
     $pager->setCount($contentService->getNumberOfObjects());
     // Assign values.
     $this->view->assign('columns', $columns);
     $this->view->assign('objects', $contentService->getObjects());
     $this->view->assign('numberOfObjects', $contentService->getNumberOfObjects());
     $this->view->assign('pager', $pager);
     $this->view->assign('response', $this->response);
 }