CloudPostgreSQL
in package
Class to handle PostgreSQL connection Feel free to use a distribute it.
last-update 2022-12-29
Table of Contents
Properties
- $_affectedRows : mixed
- $_cloudAutoSelectFields : mixed
- $_cloudDependences : mixed
- $_cloudFilterToAvoidCalculation : mixed
- $_cloudFilterWhereFields : mixed
- $_cloudReferalFields : mixed
- $_cloudWhereFields : mixed
- $_db : PDO
- $_dbCharset : mixed
- $_dbName : mixed
- $_dbPassword : mixed
- $_dbPort : mixed
- $_dbProxy : mixed
- $_dbProxyHeaders : mixed
- $_dbServer : mixed
- $_dbType : mixed
- $_dbUser : mixed
- $_debug : mixed
- $_lastExecutionMicrotime : mixed
- $_lastInsertId : mixed
- $_lastQuery : mixed
- $_lastRes : mixed
- $_limit : mixed
- $_onlyCreateQuery : mixed
- $_page : mixed
- $_qObject : mixed
- $_queryFieldTypes : mixed
- $affected : mixed
- $arrayedResult : mixed
- $cfmode : mixed
- $error : mixed
- $errorCode : mixed
- $errorMsg : mixed
- $rawResults : mixed
- $records : mixed
- $result : mixed
- $_dblink : mixed
- $core : mixed
Methods
- __construct() : mixed
- Class Constructor
- addError() : mixed
- Add an error in the class
- close() : mixed
- Close the opened connection
- connect() : bool
- Init a PDO connection with the database
- getDataFromQuery() : mixed
- joinQueryValues() : array<string|int, mixed>|mixed|string|array<string|int, string>|null
- Join $values array with $q string wich contains %s elements
- loadCoreConfigVars() : mixed
- Load variables from $this->core->config
- scapeValue() : string
- Apply $this->_db->real_escape_string or addslashes if there is not db objext
- setConfiVars() : mixed
- Set ConfigVars for connection
- _buildQuery() : array<string|int, mixed>|false|mixed|string|array<string|int, string>|null
- Build a Query receiving a string with %s as first parameter and an array of values as second paramater
Properties
$_affectedRows
public
mixed
$_affectedRows
= \null
$_cloudAutoSelectFields
public
mixed
$_cloudAutoSelectFields
= array()
$_cloudDependences
public
mixed
$_cloudDependences
= array()
$_cloudFilterToAvoidCalculation
public
mixed
$_cloudFilterToAvoidCalculation
= array()
$_cloudFilterWhereFields
public
mixed
$_cloudFilterWhereFields
= array()
$_cloudReferalFields
public
mixed
$_cloudReferalFields
= array()
$_cloudWhereFields
public
mixed
$_cloudWhereFields
= array()
$_db
public
PDO
$_db
$_dbCharset
public
mixed
$_dbCharset
= ''
$_dbName
public
mixed
$_dbName
$_dbPassword
public
mixed
$_dbPassword
$_dbPort
public
mixed
$_dbPort
= '5432'
$_dbProxy
public
mixed
$_dbProxy
= \null
$_dbProxyHeaders
public
mixed
$_dbProxyHeaders
= \null
$_dbServer
public
mixed
$_dbServer
$_dbType
public
mixed
$_dbType
= 'mysql'
$_dbUser
public
mixed
$_dbUser
$_debug
public
mixed
$_debug
= \false
$_lastExecutionMicrotime
public
mixed
$_lastExecutionMicrotime
= 0
$_lastInsertId
public
mixed
$_lastInsertId
= ''
$_lastQuery
public
mixed
$_lastQuery
= ''
$_lastRes
public
mixed
$_lastRes
= \false
$_limit
public
mixed
$_limit
= 10000
$_onlyCreateQuery
public
mixed
$_onlyCreateQuery
= \false
$_page
public
mixed
$_page
= 0
$_qObject
public
mixed
$_qObject
= array()
$_queryFieldTypes
public
mixed
$_queryFieldTypes
= array()
$affected
public
mixed
$affected
$arrayedResult
public
mixed
$arrayedResult
$cfmode
public
mixed
$cfmode
= \true
$error
public
mixed
$error
= \false
$errorCode
public
mixed
$errorCode
= \null
$errorMsg
public
mixed
$errorMsg
= []
$rawResults
public
mixed
$rawResults
$records
public
mixed
$records
$result
public
mixed
$result
$_dblink
protected
mixed
$_dblink
= \false
$core
protected
mixed
$core
= \null
Methods
__construct()
Class Constructor
public
__construct(Core7 &$core[, array<string|int, string> $options = ['dbServer' => '', 'dbUser' => '', 'dbPassword' => '', 'dbName' => '', 'dbPort' => '5432', 'dbCharset' => ''] ]) : mixed
Parameters
- $core : Core7
- $options : array<string|int, string> = ['dbServer' => '', 'dbUser' => '', 'dbPassword' => '', 'dbName' => '', 'dbPort' => '5432', 'dbCharset' => '']
addError()
Add an error in the class
public
addError(string $code, $message) : mixed
Parameters
close()
Close the opened connection
public
close() : mixed
connect()
Init a PDO connection with the database
public
connect([mixed $options = [] ]) : bool
reference: https://www.php.net/manual/en/pdo.connections.php
Parameters
- $options : mixed = []
Return values
bool —True if connection is ok.
getDataFromQuery()
public
getDataFromQuery() : mixed
joinQueryValues()
Join $values array with $q string wich contains %s elements
public
joinQueryValues( $q, $values) : array<string|int, mixed>|mixed|string|array<string|int, string>|null
Parameters
Return values
array<string|int, mixed>|mixed|string|array<string|int, string>|nullloadCoreConfigVars()
Load variables from $this->core->config
public
loadCoreConfigVars() : mixed
scapeValue()
Apply $this->_db->real_escape_string or addslashes if there is not db objext
public
scapeValue( $value) : string
Parameters
Return values
stringsetConfiVars()
Set ConfigVars for connection
public
setConfiVars(mixed $configVars) : mixed
Parameters
- $configVars : mixed
_buildQuery()
Build a Query receiving a string with %s as first parameter and an array of values as second paramater
private
_buildQuery( $args) : array<string|int, mixed>|false|mixed|string|array<string|int, string>|null