/** * {@inheritDoc} */ public function count() { // Avoid using EagerCursor::count as this stores a collection without limits to memory if ($this->cursor->getBaseCursor() instanceof EagerCursor) { return $this->cursor->getBaseCursor()->getCursor()->count(); } return $this->cursor->count(); }
public function __construct(Cursor $cursor) { $this->cursor = $cursor; $info = $cursor->info(); $this->firstResult = $info['skip']; $this->maxResults = $info['limit']; $this->totalItems = $cursor->count(); }
/** * {@inheritDoc} */ public function count() { return $this->cursor->count(); }