public function setCursorMode($mode) {
        switch($mode) {
            case DB::CURSOR_FIRST:
            case DB::CURSOR_PREV:
            case DB::CURSOR_NEXT:
            case DB::CURSOR_LAST:
                $this->cursorMode = $mode;
                break;
            default:
                throw new \InvalidArgumentException('Invalid cursor mode');
        }
    }