XOOPS
2.6.0
|
Public Member Functions | |
__construct (array $params,\Doctrine\DBAL\Driver $driver,\Doctrine\DBAL\Configuration $config=null,\Doctrine\Common\EventManager $eventManager=null) | |
beginTransaction () | |
commit () | |
createXoopsQueryBuilder () | |
deletePrefix ($tableName, array $identifier) | |
executeQuery ($query, array $params=array(), $types=array(),\Doctrine\DBAL\Cache\QueryCacheProfile $qcp=null) | |
executeUpdate ($query, array $params=array(), array $types=array()) | |
insertPrefix ($tableName, array $data, array $types=array()) | |
query () | |
queryFromFile ($file) | |
quoteSlash ($input) | |
rollBack () | |
updatePrefix ($tableName, array $data, array $identifier, array $types=array()) | |
Static Public Member Functions | |
static | getForce () |
static | getSafe () |
static | prefix ($tablename= '') |
static | setForce ($force=false) |
static | setSafe ($safe=true) |
Static Protected Attributes | |
static | $force |
static | $safe |
static | $transactionActive |
Definition at line 29 of file Connection.php.
Xoops\Core\Database\Connection::__construct | ( | array | $params, |
\Doctrine\DBAL\Driver | $driver, | ||
\Doctrine\DBAL\Configuration | $config = null , |
||
\Doctrine\Common\EventManager | $eventManager = null |
||
) |
Initializes a new instance of the Connection class.
This sets up necessary variables before calling parent constructor
array | $params | Parameters for the driver |
Driver | $driver | The driver to use |
Configuration | $config | The connection configuration |
EventManager | $eventManager | Event manager to use |
Definition at line 107 of file Connection.php.
References $_SERVER, and Xoops\$config.
Xoops\Core\Database\Connection::beginTransaction | ( | ) |
Starts a transaction by suspending auto-commit mode.
Definition at line 284 of file Connection.php.
Xoops\Core\Database\Connection::commit | ( | ) |
Xoops\Core\Database\Connection::createXoopsQueryBuilder | ( | ) |
Create a new instance of a SQL query builder.
Definition at line 397 of file Connection.php.
Xoops\Core\Database\Connection::deletePrefix | ( | $tableName, | |
array | $identifier | ||
) |
Executes an SQL DELETE statement on a table.
Adds prefix to the name of the table then passes to delete function.
string | $tableName | The name of the table on which to delete. |
array | $identifier | The deletion criteria. An associative array containing column-value pairs. |
Definition at line 201 of file Connection.php.
References Xoops\Core\Database\Connection\prefix().
Xoops\Core\Database\Connection::executeQuery | ( | $query, | |
array | $params = array() , |
||
$types = array() , |
|||
\Doctrine\DBAL\Cache\QueryCacheProfile | $qcp = null |
||
) |
Executes an, optionally parameterized, SQL query.
If the query is parameterized, a prepared statement is used. If an SQLLogger is configured, the execution is logged.
string | $query | The SQL query to execute. |
array | $params | The parameters to bind to the query, if any. |
array | $types | The types the previous parameters are in. |
QueryCacheProfile | $qcp | The query Cache profile |
PERF: Directly prepares a driver statement, not a wrapper.
Definition at line 222 of file Connection.php.
References $query.
Xoops\Core\Database\Connection::executeUpdate | ( | $query, | |
array | $params = array() , |
||
array | $types = array() |
||
) |
Executes an SQL INSERT/UPDATE/DELETE query with the given parameters and returns the number of affected rows.
This method supports PDO binding types as well as DBAL mapping types.
This over ridding process checks to make sure it is safe to do these. If force is active then it will over ride the safe setting.
string | $query | The SQL query. |
array | $params | The query parameters. |
array | $types | The parameter types. |
PERF: Directly prepares a driver statement, not a wrapper.
Definition at line 250 of file Connection.php.
References $query, $result, and Xoops\getInstance().
|
static |
this is a public getter for the $force variable
Definition at line 92 of file Connection.php.
|
static |
this is a public getter for the safe variable
Definition at line 68 of file Connection.php.
Xoops\Core\Database\Connection::insertPrefix | ( | $tableName, | |
array | $data, | ||
array | $types = array() |
||
) |
Inserts a table row with specified data.
Adds prefix to the name of the table then passes to normal function.
string | $tableName | The name of the table to insert data into. |
array | $data | An associative array containing column-value pairs. |
array | $types | Types of the inserted data. |
Definition at line 162 of file Connection.php.
References Xoops\Core\Database\Connection\prefix().
|
static |
Prepend the prefix.'_' to the given tablename If tablename is empty, just return the prefix.
string | $tablename | tablename |
Definition at line 139 of file Connection.php.
References XoopsBaseConfig\get().
Referenced by Xoops\Core\Database\QueryBuilder\deletePrefix(), Xoops\Core\Database\Connection\deletePrefix(), Xoops\Core\Database\QueryBuilder\fromPrefix(), Xoops\Core\Database\QueryBuilder\innerJoinPrefix(), Xoops\Core\Database\QueryBuilder\insertPrefix(), Xoops\Core\Database\Connection\insertPrefix(), Xoops\Core\Database\QueryBuilder\joinPrefix(), Xoops\Core\Database\QueryBuilder\leftJoinPrefix(), Xoops\Core\Database\Connection\queryFromFile(), Xoops\Core\Database\QueryBuilder\rightJoinPrefix(), Xoops\Core\Database\QueryBuilder\updatePrefix(), and Xoops\Core\Database\Connection\updatePrefix().
Xoops\Core\Database\Connection::query | ( | ) |
perform a safe query if allowed can receive variable number of arguments
add error report for using non select while not safe.
need to check if doctrine allows more than one query to be sent. This code assumes only one query is sent and anything else sent is not a query. This will have to be readdressed if this is wrong.
Definition at line 326 of file Connection.php.
References $result, $sql, and Xoops\getInstance().
Referenced by Xoops\Core\Database\Connection\queryFromFile().
Xoops\Core\Database\Connection::queryFromFile | ( | $file | ) |
perform queries from SQL dump file in a batch
string | $file | file path to an SQL dump file |
Definition at line 362 of file Connection.php.
References $file, $query, Xoops\Core\Database\Connection\prefix(), SqlUtility\prefixQuery(), Xoops\Core\Database\Connection\query(), and SqlUtility\splitMySqlFile().
Xoops\Core\Database\Connection::quoteSlash | ( | $input | ) |
Duplicates original xoops quote. Name changed to not confuse normal usage of quote.
string | $input | test to convert |
Definition at line 386 of file Connection.php.
Xoops\Core\Database\Connection::rollBack | ( | ) |
|
static |
this is a public setter for the $force variable
bool | $force | when true will force a write to database when safe is false. |
Definition at line 80 of file Connection.php.
References Xoops\Core\Database\Connection\$force.
|
static |
this is a public setter for the safe variable
bool | $safe | set safe to true if safe to write data to database |
Definition at line 56 of file Connection.php.
References Xoops\Core\Database\Connection\$safe.
Xoops\Core\Database\Connection::updatePrefix | ( | $tableName, | |
array | $data, | ||
array | $identifier, | ||
array | $types = array() |
||
) |
Executes an SQL UPDATE statement on a table.
Adds prefix to the name of the table then passes to normal function.
string | $tableName | The name of the table to update. |
array | $data | The data to update |
array | $identifier | The update criteria. An associative array containing column-value pairs. |
array | $types | Types of the merged $data and $identifier arrays in that order. |
Definition at line 183 of file Connection.php.
References Xoops\Core\Database\Connection\prefix().
|
staticprotected |
Definition at line 41 of file Connection.php.
Referenced by Xoops\Core\Database\Connection\setForce().
|
staticprotected |
Definition at line 35 of file Connection.php.
Referenced by Xoops\Core\Database\Connection\setSafe().
|
staticprotected |
Definition at line 46 of file Connection.php.