jDb
in package
factory for database connector and other db utilities.
Tags
Table of Contents
- _createConnector() : jDbConnection|jDbPDOConnection
- create a connector. internal use (callback method for jProfiles).
- floatToStr() : mixed
- perform a convertion float to str. It takes care about the decimal separator which should be a '.' for SQL. Because when doing a native convertion float->str, PHP uses the local decimal separator, and so, we don't want that.
- getConnection() : jDbConnection
- return a database connector. It uses a temporay pool of connection to reuse currently opened connections.
- getDbWidget() : jDbWidget
- create a new jDbWidget.
- testProfile() : bool
- call it to test a profile (during an install for example).
Methods
_createConnector()
create a connector. internal use (callback method for jProfiles).
public
static _createConnector(array<string|int, mixed> $profile) : jDbConnection|jDbPDOConnection
Parameters
- $profile : array<string|int, mixed>
-
profile properties
Tags
Return values
jDbConnection|jDbPDOConnection —database connector
floatToStr()
perform a convertion float to str. It takes care about the decimal separator which should be a '.' for SQL. Because when doing a native convertion float->str, PHP uses the local decimal separator, and so, we don't want that.
public
static floatToStr(mixed $value) : mixed
Parameters
- $value : mixed
Tags
Return values
mixed —getConnection()
return a database connector. It uses a temporay pool of connection to reuse currently opened connections.
public
static getConnection([string $name = '' ]) : jDbConnection
Parameters
- $name : string = ''
-
profile name to use. if empty, use the default one
Return values
jDbConnection —the connector
getDbWidget()
create a new jDbWidget.
public
static getDbWidget([string $name = null ]) : jDbWidget
Parameters
- $name : string = null
-
profile name to use. if empty, use the default one
Return values
jDbWidget —testProfile()
call it to test a profile (during an install for example).
public
static testProfile(array<string|int, mixed> $profile) : bool
Parameters
- $profile : array<string|int, mixed>
-
profile properties
Return values
bool —true if properties are ok