示例#1
0
 /**
  * @param string $filterValue
  */
 public function indexAction($filterValue = '')
 {
     $filterValue = trim($filterValue);
     $query = clone $this->objects->getQuery();
     $constraintSoFar = $query->getConstraint();
     $filterConstraint = $query->like($this->filterProperty, $filterValue . '%');
     if ($constraintSoFar) {
         $query->matching($query->logicalAnd($constraintSoFar, $filterConstraint));
     } else {
         $query->matching($filterConstraint);
     }
     $modifiedObjects = $query->execute();
     $this->view->assign('contentArguments', array($this->widgetConfiguration['as'] => $modifiedObjects));
     $this->view->assign('filterValue', $filterValue);
     $this->view->assign('filterPlaceholder', $this->widgetConfiguration['filterPlaceholder']);
 }
 /**
  * @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());
 }
 public function hideDummies(\TYPO3\Flow\Persistence\QueryResultInterface $objects)
 {
     $query = clone $objects->getQuery();
     $constraint = $query->getConstraint();
     if ($constraint !== NULL) {
         $query->matching($query->logicalAnd($constraint, $query->equals('isDummy', false)));
     } else {
         $query->matching($query->equals('isDummy', false));
     }
     return $query->execute();
 }