Example #1
0
 /**
  * Takes a pile of commits, then puts together all the repositories that are affected by
  * at least one of the given commits.
  *
  * @param \TYPO3\Flow\Persistence\QueryResultInterface the pile of commits
  * @return \Doctrine\Common\Collections\ArrayCollection the resulting stack of repositories
  */
 public function extractTheRepositoriesFromAStackOfCommits(\TYPO3\Flow\Persistence\QueryResultInterface $commits)
 {
     $result = new \Doctrine\Common\Collections\ArrayCollection();
     if ($commits->count()) {
         foreach ($commits as $commit) {
             if (!$result->contains($commit->getRepository())) {
                 $result->add($commit->getRepository());
             }
         }
     }
     return $result;
 }
Example #2
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();
 }