MongoCommandCursor::ensureCursor PHP Method

ensureCursor() protected method

protected ensureCursor ( ) : MongoDB\Driver\Cursor
return MongoDB\Driver\Cursor
    protected function ensureCursor()
    {
        if ($this->cursor === null) {
            $convertedCommand = TypeConverter::fromLegacy($this->command);
            if (isset($convertedCommand->cursor)) {
                if ($convertedCommand->cursor === true || $convertedCommand->cursor === []) {
                    $convertedCommand->cursor = new \stdClass();
                }
            }
            $this->cursor = $this->db->command($convertedCommand, $this->getOptions());
        }
        return $this->cursor;
    }