|
| __construct ($dbType, $dbName, $serverName="localhost", $port="3306", $user="root", $password="", $options=[], $cache=false) |
| Constructor. More...
|
|
| connect () |
| Creates the PDO instance. More...
|
|
| query ($sql) |
| Executes an SQL statement, returning a result set as a PDOStatement object. More...
|
|
| prepareAndExecute ($tableName, $condition, $fields, $useCache=NULL) |
|
| execute ($sql) |
| Execute an SQL statement and return the number of affected rows (INSERT, UPDATE or DELETE) More...
|
|
| getServerName () |
|
| setServerName ($serverName) |
|
| prepareStatement ($sql) |
| Prepares a statement for execution and returns a statement object. More...
|
|
| bindValueFromStatement (\PDOStatement $statement, $parameter, $value) |
| Sets $value to $parameter. More...
|
|
| lastInserId () |
| Returns the last insert id. More...
|
|
| getTablesName () |
|
| count ($tableName, $condition='') |
| Returns the number of records in $tableName that respects the condition passed as a parameter. More...
|
|
| isConnected () |
|
| setDbType ($dbType) |
|
| getPort () |
|
| getDbName () |
|
| getUser () |
|
| getPdoObject () |
|
Definition at line 15 of file Database.php.
◆ __construct()
__construct |
( |
|
$dbType, |
|
|
|
$dbName, |
|
|
|
$serverName = "localhost" , |
|
|
|
$port = "3306" , |
|
|
|
$user = "root" , |
|
|
|
$password = "" , |
|
|
|
$options = [] , |
|
|
|
$cache = false |
|
) |
| |
Constructor.
- Parameters
-
string | $dbName | |
string | $serverName | |
string | $port | |
string | $user | |
string | $password | |
array | $options | |
boolean | string | $cache | |
Definition at line 37 of file Database.php.
◆ bindValueFromStatement()
bindValueFromStatement |
( |
\PDOStatement |
$statement, |
|
|
|
$parameter, |
|
|
|
$value |
|
) |
| |
Sets $value to $parameter.
- Parameters
-
\PDOStatement | $statement | |
String | $parameter | |
mixed | $value | |
- Returns
- boolean
Definition at line 148 of file Database.php.
◆ connect()
◆ count()
count |
( |
|
$tableName, |
|
|
|
$condition = '' |
|
) |
| |
Returns the number of records in $tableName that respects the condition passed as a parameter.
- Parameters
-
string | $tableName | |
string | $condition | Partie suivant le WHERE d'une instruction SQL |
Definition at line 171 of file Database.php.
◆ execute()
Execute an SQL statement and return the number of affected rows (INSERT, UPDATE or DELETE)
- Parameters
-
- Returns
- int the number of rows that were modified or deleted by the SQL statement you issued
Definition at line 120 of file Database.php.
◆ getDbName()
◆ getPdoObject()
◆ getPort()
◆ getServerName()
◆ getStatement()
◆ getTablesName()
◆ getUser()
◆ isConnected()
◆ lastInserId()
Returns the last insert id.
- Returns
- integer
Definition at line 156 of file Database.php.
◆ prepareAndExecute()
prepareAndExecute |
( |
|
$tableName, |
|
|
|
$condition, |
|
|
|
$fields, |
|
|
|
$useCache = NULL |
|
) |
| |
- Parameters
-
string | $tableName | |
string | $condition | |
array | string | $fields | |
boolean | null | $useCache | |
- Returns
- boolean|array
Definition at line 84 of file Database.php.
◆ prepareStatement()
Prepares a statement for execution and returns a statement object.
- Parameters
-
- Returns
Definition at line 137 of file Database.php.
◆ query()
Executes an SQL statement, returning a result set as a PDOStatement object.
- Parameters
-
- Returns
Definition at line 73 of file Database.php.
◆ setDbType()
◆ setServerName()
setServerName |
( |
|
$serverName | ) |
|
◆ $cache
◆ $dbName
◆ $dbType
◆ $options
◆ $password
◆ $pdoObject
◆ $port
◆ $serverName
◆ $statements
◆ $user
The documentation for this class was generated from the following file: