Пример #1
0
 /**
  * @test
  * @expectedException \InvalidArgumentException
  */
 public function setOffsetRejectsIntegersLessThanZero()
 {
     $this->query->setOffset(-1);
 }
Пример #2
0
 /**
  * Sets a limit on an extbase query by given query object. Returns manipulated extbase query.
  *
  * @param Tx_PtExtlist_Domain_QueryObject_Query $query
  * @param \TYPO3\CMS\Extbase\Persistence\Generic\Query $extbaseQuery
  * @return \TYPO3\CMS\Extbase\Persistence\Generic\Query
  */
 public static function setLimitOnExtBaseQueryByQueryObject(Tx_PtExtlist_Domain_QueryObject_Query $query, \TYPO3\CMS\Extbase\Persistence\Generic\Query $extbaseQuery)
 {
     if ($query->getLimit() != '') {
         list($offset, $limit) = explode(':', $query->getLimit());
         if (!$limit > 0) {
             $extbaseQuery->setLimit(intval($offset));
             // no offset set, so offset = limit
         } else {
             $extbaseQuery->setOffset(intval($offset));
             $extbaseQuery->setLimit(intval($limit));
         }
     }
     return $extbaseQuery;
 }
Пример #3
0
 /**
  * Sets the start offset of the result set to offset. Returns $this to
  * allow for chaining (fluid interface)
  *
  * @param integer $offset
  * @return \TYPO3\CMS\Extbase\Persistence\QueryInterface
  */
 public function setOffset($offset)
 {
     parent::setOffset($offset);
     if ($this->statement) {
         $this->sqlParser->setLimitStatement($this->getLimitStatement());
         $statement = $this->sqlParser->toString();
         $this->statement = $this->qomFactory->statement($statement, $this->parameters);
     }
     return $this;
 }