\JSONDB\JSONDB

Class JSONDB

Summary

Constants

PARAM_STRING

PARAM_STRING

Parses a value to string for prepared queries.

PARAM_INT

PARAM_INT

Parses a value to integer for prepared queries.

PARAM_BOOL

PARAM_BOOL

Parses a value to boolean for prepared queries.

PARAM_NULL

PARAM_NULL

Parses a value to null for prepared queries.

PARAM_ARRAY

PARAM_ARRAY

Parses a value to array for prepared queries.

FETCH_ARRAY

FETCH_ARRAY

Defines if we fetch results as array.

FETCH_OBJECT

FETCH_OBJECT

Defines if we fetch results as object.

FETCH_CLASS

FETCH_CLASS

Defines if we fetch results by mapping a defined class.

Properties

$instance

$instance : \JSONDB\JSONDB
Description Current JSONDB class instance
Type \JSONDB\JSONDB

Methods

__construct()

__construct()

JSONDB __constructor.

getInstance()

getInstance() : \JSONDB\JSONDB

Returns the current JSONDB instance.

Returns

\JSONDB\JSONDB

static

createServer()

createServer(string  $name, string  $username, string  $password, boolean  $connect = FALSE) : \JSONDB\JSONDB|\JSONDB\Database

Creates a new server.

Parameters
string $name The server's name
string $username The server's username
string $password The server's password
boolean $connect Defines if JSONDB have to connect directly to the server after the creation
Throws

\JSONDB\Exception

Returns

\JSONDB\JSONDB|\JSONDB\Database

connect()

connect(string  $name, string  $username, string  $password, string  $database = NULL) : \JSONDB\Database

Connects to a database.

Parameters
string $name The server's name
string $username The username used to connect
string $password The password used to connect
string $database The name of the database
Throws

\JSONDB\Exception

Returns

\JSONDB\Database

quote()

quote(string  $value) : string

Escapes reserved characters and quotes a value.

Parameters
string $value The value to quote
Returns

string

Link

\JSONDB\QueryParser::quote()

static