Neos\Flow\Persistence\Generic\Query::setOffset PHP Метод

setOffset() публичный Метод

Sets the start offset of the result set to $offset. Returns $this to allow for chaining (fluid interface)
public setOffset ( integer $offset ) : Neos\Flow\Persistence\QueryInterface
$offset integer
Результат Neos\Flow\Persistence\QueryInterface
    public function setOffset($offset)
    {
        if ($offset < 1 || !is_int($offset)) {
            throw new \InvalidArgumentException('setOffset() accepts only integers greater 0.', 1263387252);
        }
        $this->offset = $offset;
        return $this;
    }

Usage Example

 /**
  * @test
  * @expectedException \InvalidArgumentException
  */
 public function setOffsetRejectsIntegersLessThanZero()
 {
     $this->query->setOffset(-1);
 }