Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
AbstractDbWrapper Class Reference

Ubiquity\db\providers$AbstractDbWrapper This class is part of Ubiquity. More...

+ Inheritance diagram for AbstractDbWrapper:

Public Member Functions

 query (string $sql)
 
 queryAll (string $sql, int $fetchStyle=null)
 
 queryColumn (string $sql, int $columnNumber=null)
 
 _getStatement (string $sql)
 
 prepareNamedStatement (string $name, string $sql)
 
 getNamedStatement (string $name, ?string $sql=null)
 
 getStatement (string $sql)
 
 connect (string $dbType, $dbName, $serverName, string $port, string $user, string $password, array $options)
 
 getDSN (string $serverName, string $port, string $dbName, string $dbType='mysql')
 
 execute (string $sql)
 
 prepareStatement (string $sql)
 
 executeStatement ($statement, array $values=null)
 
 statementRowCount ($statement)
 
 lastInsertId ($name=null)
 
 bindValueFromStatement ($statement, $parameter, $value)
 Used by DAO.
 
 fetchColumn ($statement, array $values=null, int $columnNumber=null)
 
 fetchAll ($statement, array $values=null, $mode=null)
 
 fetchOne ($statement, array $values=null, $mode=null)
 
 fetchAllColumn ($statement, array $values=null, string $column=null)
 
 getTablesName ()
 
 beginTransaction ()
 
 commit ()
 
 inTransaction ()
 
 rollBack ()
 
 nestable ()
 
 savePoint ($level)
 
 releasePoint ($level)
 
 rollbackPoint ($level)
 
 ping ()
 
 getPrimaryKeys ($tableName)
 
 getFieldsInfos ($tableName)
 
 getForeignKeys ($tableName, $pkName, $dbName=null)
 
 _optPrepareAndExecute ($sql, array $values=null, $one=false)
 
 _optExecuteAndFetch ($statement, array $values=null, $one=false)
 
 getRowNum (string $tableName, string $pkName, string $condition)
 
 groupConcat (string $fields, string $separator)
 
 toStringOperator ()
 
 close ()
 
 getDbInstance ()
 
 setDbInstance ($dbInstance)
 
 quoteValue ($value, $type=2)
 
 getPHPType (string $dbType)
 
 migrateOperation (string $operation)
 Returns the SQL string for a migration operation.
 
 setIsolationLevel ($isolationLevel)
 

Static Public Member Functions

static getAvailableDrivers ()
 

Data Fields

const PHP_TYPES = [ 'string' => true,'bool' => true,'float' => true,'int' => true ]
 
 $quote
 

Protected Attributes

 $dbInstance
 
 $statements
 
 $operations
 

Detailed Description

Ubiquity\db\providers$AbstractDbWrapper This class is part of Ubiquity.

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.0.6

Definition at line 15 of file AbstractDbWrapper.php.

Member Function Documentation

◆ _getStatement()

_getStatement ( string  $sql)

Definition at line 43 of file AbstractDbWrapper.php.

◆ _optExecuteAndFetch()

_optExecuteAndFetch (   $statement,
array  $values = null,
  $one = false 
)

Reimplemented in PDOWrapper.

Definition at line 116 of file AbstractDbWrapper.php.

◆ _optPrepareAndExecute()

_optPrepareAndExecute (   $sql,
array  $values = null,
  $one = false 
)
abstract

Reimplemented in PDOWrapper.

◆ beginTransaction()

beginTransaction ( )
abstract

Reimplemented in PDOWrapper.

◆ bindValueFromStatement()

bindValueFromStatement (   $statement,
  $parameter,
  $value 
)
abstract

Used by DAO.

Parameters
mixed$statement
string$parameter
mixed$value

Reimplemented in PDOWrapper.

◆ close()

close ( )

Definition at line 127 of file AbstractDbWrapper.php.

◆ commit()

commit ( )
abstract

Reimplemented in PDOWrapper.

◆ connect()

connect ( string  $dbType,
  $dbName,
  $serverName,
string  $port,
string  $user,
string  $password,
array  $options 
)
abstract

Reimplemented in PDOWrapper.

◆ execute()

execute ( string  $sql)
abstract

◆ executeStatement()

executeStatement (   $statement,
array  $values = null 
)
abstract

Reimplemented in PDOWrapper.

◆ fetchAll()

fetchAll (   $statement,
array  $values = null,
  $mode = null 
)
abstract

Reimplemented in PDOWrapper.

◆ fetchAllColumn()

fetchAllColumn (   $statement,
array  $values = null,
string  $column = null 
)
abstract

Reimplemented in PDOWrapper.

◆ fetchColumn()

fetchColumn (   $statement,
array  $values = null,
int  $columnNumber = null 
)
abstract

Reimplemented in PDOWrapper.

◆ fetchOne()

fetchOne (   $statement,
array  $values = null,
  $mode = null 
)
abstract

Reimplemented in PDOWrapper.

◆ getAvailableDrivers()

static getAvailableDrivers ( )
staticabstract

Reimplemented in PDOWrapper.

◆ getDbInstance()

getDbInstance ( )
Returns
object

Definition at line 136 of file AbstractDbWrapper.php.

◆ getDSN()

getDSN ( string  $serverName,
string  $port,
string  $dbName,
string  $dbType = 'mysql' 
)
abstract

Reimplemented in PDOWrapper.

◆ getFieldsInfos()

getFieldsInfos (   $tableName)
abstract

Reimplemented in PDOWrapper.

◆ getForeignKeys()

getForeignKeys (   $tableName,
  $pkName,
  $dbName = null 
)
abstract

Reimplemented in PDOWrapper.

◆ getNamedStatement()

getNamedStatement ( string  $name,
?string  $sql = null 
)

Definition at line 51 of file AbstractDbWrapper.php.

◆ getPHPType()

getPHPType ( string  $dbType)
Parameters
string$dbType
Returns
string
Deprecated:
use Database::getPHPType instead

Definition at line 159 of file AbstractDbWrapper.php.

◆ getPrimaryKeys()

getPrimaryKeys (   $tableName)
abstract

Reimplemented in PDOWrapper.

◆ getRowNum()

getRowNum ( string  $tableName,
string  $pkName,
string  $condition 
)
abstract

Reimplemented in PDOWrapper.

◆ getStatement()

getStatement ( string  $sql)
abstract

◆ getTablesName()

getTablesName ( )
abstract

Reimplemented in PDOWrapper.

◆ groupConcat()

groupConcat ( string  $fields,
string  $separator 
)
abstract

Reimplemented in PDOWrapper.

◆ inTransaction()

inTransaction ( )
abstract

Reimplemented in PDOWrapper.

◆ lastInsertId()

lastInsertId (   $name = null)
abstract

Reimplemented in PDOWrapper.

◆ migrateOperation()

migrateOperation ( string  $operation)

Returns the SQL string for a migration operation.

Parameters
string$operation
Returns
string

Reimplemented in PDOWrapper.

Definition at line 168 of file AbstractDbWrapper.php.

◆ nestable()

nestable ( )
abstract

Reimplemented in PDOWrapper.

◆ ping()

ping ( )
abstract

Reimplemented in PDOWrapper.

◆ prepareNamedStatement()

prepareNamedStatement ( string  $name,
string  $sql 
)

Definition at line 47 of file AbstractDbWrapper.php.

◆ prepareStatement()

prepareStatement ( string  $sql)
abstract

Reimplemented in PDOWrapper.

◆ query()

query ( string  $sql)
abstract

Reimplemented in PDOWrapper.

◆ queryAll()

queryAll ( string  $sql,
int  $fetchStyle = null 
)
abstract

Reimplemented in PDOWrapper.

◆ queryColumn()

queryColumn ( string  $sql,
int  $columnNumber = null 
)
abstract

Reimplemented in PDOWrapper.

◆ quoteValue()

quoteValue (   $value,
  $type = 2 
)

Reimplemented in PDOWrapper.

Definition at line 148 of file AbstractDbWrapper.php.

◆ releasePoint()

releasePoint (   $level)
abstract

Reimplemented in PDOWrapper.

◆ rollBack()

rollBack ( )
abstract

Reimplemented in PDOWrapper.

◆ rollbackPoint()

rollbackPoint (   $level)
abstract

Reimplemented in PDOWrapper.

◆ savePoint()

savePoint (   $level)
abstract

Reimplemented in PDOWrapper.

◆ setDbInstance()

setDbInstance (   $dbInstance)
Parameters
object$dbInstance

Definition at line 144 of file AbstractDbWrapper.php.

◆ setIsolationLevel()

setIsolationLevel (   $isolationLevel)
Parameters
$isolationLevel
Exceptions
DBException
Returns
mixed

Reimplemented in PDOWrapper.

Definition at line 177 of file AbstractDbWrapper.php.

◆ statementRowCount()

statementRowCount (   $statement)
abstract

Reimplemented in PDOWrapper.

◆ toStringOperator()

toStringOperator ( )

Reimplemented in PDOWrapper.

Definition at line 123 of file AbstractDbWrapper.php.

Field Documentation

◆ $dbInstance

$dbInstance
protected

Definition at line 16 of file AbstractDbWrapper.php.

◆ $operations

$operations
protected
Initial value:
=[
DbOperations::CREATE_DATABASE=>'CREATE DATABASE {name}',
DbOperations::CREATE_TABLE=>'CREATE TABLE {name} ({fields}) {attributes}',
DbOperations::SELECT_DB=>'USE {name}',
DbOperations::FIELD=>'{name} {type} {extra}',
DbOperations::ALTER_TABLE=>'ALTER TABLE {tableName} {alter}',
DbOperations::FOREIGN_KEY=>'ALTER TABLE {tableName} ADD CONSTRAINT {fkName} FOREIGN KEY ({fkFieldName}) REFERENCES {referencesTableName} ({referencesFieldName}) ON DELETE {onDelete} ON UPDATE {onUpdate}',
DbOperations::ALTER_TABLE_KEY=>'ALTER TABLE {tableName} ADD {type} KEY ({pkFields})',
DbOperations::AUTO_INC=>'ALTER TABLE {tableName} MODIFY {fieldName} AUTO_INCREMENT, AUTO_INCREMENT={value}',
DbOperations::MODIFY_FIELD=>'ALTER TABLE {tableName} MODIFY {fieldName} {attributes}',
DbOperations::ADD_FIELD=>'ALTER TABLE {tableName} ADD {fieldName} {attributes}'
]

Definition at line 18 of file AbstractDbWrapper.php.

◆ $quote

$quote

Definition at line 33 of file AbstractDbWrapper.php.

◆ $statements

$statements
protected

Definition at line 17 of file AbstractDbWrapper.php.

◆ PHP_TYPES

const PHP_TYPES = [ 'string' => true,'bool' => true,'float' => true,'int' => true ]

Definition at line 31 of file AbstractDbWrapper.php.


The documentation for this class was generated from the following file: