for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Pagerfanta package.
*
* (c) Pablo Díez <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Pagerfanta\Adapter;
/**
* MongoAdapter.
* @author Sergey Ponomaryov <[email protected]>
class MongoAdapter implements AdapterInterface
{
private $cursor;
* Constructor.
* @param \MongoCursor $cursor The cursor.
public function __construct(\MongoCursor $cursor)
$this->cursor = $cursor;
}
* Returns the cursor.
* @return \MongoCursor The cursor.
public function getCursor()
return $this->cursor;
* {@inheritdoc}
public function getNbResults()
return $this->cursor->count();
public function getSlice($offset, $length)
$this->cursor->limit($length);
$this->cursor->skip($offset);