Doctrine\ODM\MongoDB\PersistentCollection::slice PHP Method

slice() public method

public slice ( $offset, $length = null )
    public function slice($offset, $length = null)
    {
        $this->initialize();
        return $this->coll->slice($offset, $length);
    }

Usage Example

 public function testSlice()
 {
     list($start, $limit) = array(0, 25);
     $collection = $this->getMockCollection();
     $collection->expects($this->once())->method('slice')->with($start, $limit)->will($this->returnValue(true));
     $dm = $this->getMockDocumentManager();
     $uow = $this->getMockUnitOfWork();
     $pCollection = new PersistentCollection($collection, $dm, $uow, '$');
     $pCollection->slice($start, $limit);
 }
All Usage Examples Of Doctrine\ODM\MongoDB\PersistentCollection::slice