|
eZ Publish
[4.2]
|
The eZMySQLDB class provides MySQL implementation of the database interface. More...
Inheritance diagram for eZMySQLDB:
Collaboration diagram for eZMySQLDB:Public Member Functions | |
| arrayQuery ($sql, $params=array(), $server=false) | |
| availableDatabases () | |
| beginQuery () | |
| bindingType () | |
| bindVariable ($value, $fieldDef=false) | |
| bitAnd ($arg1, $arg2) | |
| bitOr ($arg1, $arg2) | |
| checkCharset ($charset, &$currentCharset) | |
| close () | |
| commitQuery () | |
| concatString ($strings=array()) | |
| createDatabase ($dbName) | |
| databaseClientVersion () | |
| databaseName () | |
| databaseServerVersion () | |
| dropTempTable ($dropTableQuery= '', $server=self::SERVER_SLAVE) | |
| escapeString ($str) | |
| eZMySQLDB ($parameters) | |
| eZTableList ($server=eZDBInterface::SERVER_MASTER) | |
| isCharsetSupported ($charset) | |
| lastSerialID ($table=false, $column=false) | |
| lock ($table) | |
| md5 ($str) | |
| query ($sql, $server=false) | |
| relationCount ($relationType=eZDBInterface::RELATION_TABLE) | |
| relationCounts ($relationMask) | |
| relationList ($relationType=eZDBInterface::RELATION_TABLE) | |
| relationMatchRegexp ($relationType) | |
| removeDatabase ($dbName) | |
| removeRelation ($relationName, $relationType) | |
| rollbackQuery () | |
| setError () | |
| subString ($string, $from, $len=null) | |
| supportedRelationTypeMask () | |
| supportedRelationTypes () | |
| supportsDefaultValuesInsertion () | |
| unlock () | |
Public Attributes | |
| $CharsetMapping | |
| $TempTableList | |
Private Member Functions | |
| checkCharsetPriv ($charset, &$currentCharset) | |
| connect ($server, $db, $user, $password, $socketPath, $charset=null, $port=false) | |
The eZMySQLDB class provides MySQL implementation of the database interface.
eZMySQLDB is the MySQL implementation of eZDB.
Definition at line 41 of file ezmysqldb.php.
| eZMySQLDB::arrayQuery | ( | $ | sql, |
| $ | params = array(), |
||
| $ | server = false |
||
| ) | [virtual] |
Executes an SQL query and returns the result as an array of accociative arrays.
| $sql | SQL query to execute. |
| $params | Associative array containing extra parameters, can contain:
|
| $server | Which server to execute the query on, either eZDBInterface::SERVER_MASTER or eZDBInterface::SERVER_SLAVE |
An example would be:
$db->arrayQuery( 'SELECT * FROM eztable', array( 'limit' => 10, 'offset' => 5 ) );
Implements eZDBInterface.
Definition at line 476 of file ezmysqldb.php.
| eZMySQLDB::availableDatabases | ( | ) |
Return alvailable databases in database.
Reimplemented from eZDBInterface.
Definition at line 831 of file ezmysqldb.php.
| eZMySQLDB::beginQuery | ( | ) |
The query to start the transaction.
Reimplemented from eZDBInterface.
Definition at line 746 of file ezmysqldb.php.
| eZMySQLDB::bindingType | ( | ) | [virtual] |
Returns type of binding used in database plugin.
Implements eZDBInterface.
Definition at line 214 of file ezmysqldb.php.
| eZMySQLDB::bindVariable | ( | $ | value, |
| $ | fieldDef = false |
||
| ) | [virtual] |
| eZMySQLDB::bitAnd | ( | $ | arg1, |
| $ | arg2 | ||
| ) | [virtual] |
Implements eZDBInterface.
Definition at line 583 of file ezmysqldb.php.
| eZMySQLDB::bitOr | ( | $ | arg1, |
| $ | arg2 | ||
| ) | [virtual] |
Implements eZDBInterface.
Definition at line 588 of file ezmysqldb.php.
| eZMySQLDB::checkCharset | ( | $ | charset, |
| &$ | currentCharset | ||
| ) |
Checks if the requested character set matches the one used in the database.
true if it matches or false if it differs. | [out] | $currentCharset | The charset that the database uses. will only be set if the match fails. Note: This will be specific to the database. |
Reimplemented from eZDBInterface.
Definition at line 235 of file ezmysqldb.php.
| eZMySQLDB::checkCharsetPriv | ( | $ | charset, |
| &$ | currentCharset | ||
| ) | [private] |
Definition at line 264 of file ezmysqldb.php.
Referenced by checkCharset().
| eZMySQLDB::close | ( | ) | [virtual] |
Will close the database connection.
Implements eZDBInterface.
Definition at line 790 of file ezmysqldb.php.
| eZMySQLDB::commitQuery | ( | ) |
The query to commit the transaction.
Reimplemented from eZDBInterface.
Definition at line 754 of file ezmysqldb.php.
| eZMySQLDB::concatString | ( | $ | strings = array() | ) | [virtual] |
Implements eZDBInterface.
Definition at line 572 of file ezmysqldb.php.
| eZMySQLDB::connect | ( | $ | server, |
| $ | db, | ||
| $ | user, | ||
| $ | password, | ||
| $ | socketPath, | ||
| $ | charset = null, |
||
| $ | port = false |
||
| ) | [private] |
Opens a new connection to a MySQL database and returns the connection
Definition at line 116 of file ezmysqldb.php.
Referenced by eZMySQLDB().
| eZMySQLDB::createDatabase | ( | $ | dbName | ) | [virtual] |
| eZMySQLDB::databaseClientVersion | ( | ) | [virtual] |
false if no version could be retrieved/ Implements eZDBInterface.
Definition at line 874 of file ezmysqldb.php.
| eZMySQLDB::databaseName | ( | ) | [virtual] |
Returns the name of driver, this is used to determine the name of the database type. For instance multiple implementations of the MySQL database will all return 'mysql'.
Implements eZDBInterface.
Definition at line 209 of file ezmysqldb.php.
| eZMySQLDB::databaseServerVersion | ( | ) |
false if no version could be retrieved/ Reimplemented from eZDBInterface.
Definition at line 864 of file ezmysqldb.php.
Referenced by availableDatabases(), checkCharset(), connect(), and isCharsetSupported().
| eZMySQLDB::dropTempTable | ( | $ | dropTableQuery = '', |
| $ | server = self::SERVER_SLAVE |
||
| ) |
Drop temporary table
Reimplemented from eZDBInterface.
Definition at line 906 of file ezmysqldb.php.
| eZMySQLDB::escapeString | ( | $ | str | ) | [virtual] |
Will escape a string so it's ready to be inserted in the database.
Implements eZDBInterface.
Definition at line 778 of file ezmysqldb.php.
| eZMySQLDB::eZMySQLDB | ( | $ | parameters | ) |
Create a new eZMySQLDB object and connects to the database backend.
Connect to master server
Definition at line 46 of file ezmysqldb.php.
| eZMySQLDB::eZTableList | ( | $ | server = eZDBInterface::SERVER_MASTER | ) | [virtual] |
Implements eZDBInterface.
Definition at line 654 of file ezmysqldb.php.
| eZMySQLDB::isCharsetSupported | ( | $ | charset | ) |
true if the charset $charset is supported by the connected database. Reimplemented from eZDBInterface.
Definition at line 884 of file ezmysqldb.php.
Referenced by connect().
| eZMySQLDB::lastSerialID | ( | $ | table = false, |
| $ | column = false |
||
| ) | [virtual] |
Returns the last serial ID generated with an auto increment field.
Implements eZDBInterface.
Definition at line 767 of file ezmysqldb.php.
| eZMySQLDB::lock | ( | $ | table | ) | [virtual] |
| eZMySQLDB::md5 | ( | $ | str | ) | [virtual] |
Implements eZDBInterface.
Definition at line 578 of file ezmysqldb.php.
| eZMySQLDB::query | ( | $ | sql, |
| $ | server = false |
||
| ) | [virtual] |
Execute a query on the global MySQL database link. If it returns an error, the script is halted and the attempted SQL query and MySQL error message are printed.
| $sql | SQL query to execute. |
Implements eZDBInterface.
Definition at line 314 of file ezmysqldb.php.
Referenced by arrayQuery(), beginQuery(), commitQuery(), createDatabase(), lock(), removeDatabase(), removeRelation(), rollbackQuery(), and unlock().
| eZMySQLDB::relationCount | ( | $ | relationType = eZDBInterface::RELATION_TABLE | ) | [virtual] |
Implements eZDBInterface.
Definition at line 611 of file ezmysqldb.php.
Referenced by relationCounts().
| eZMySQLDB::relationCounts | ( | $ | relationMask | ) | [virtual] |
Implements eZDBInterface.
Definition at line 603 of file ezmysqldb.php.
| eZMySQLDB::relationList | ( | $ | relationType = eZDBInterface::RELATION_TABLE | ) | [virtual] |
Implements eZDBInterface.
Definition at line 630 of file ezmysqldb.php.
| eZMySQLDB::relationMatchRegexp | ( | $ | relationType | ) | [virtual] |
false. | $relationType | The type which needs to be filtered, this allows one regexp per type. |
An example, will only match tables that start with 'ez'.
return "#^ez#";
Implements eZDBInterface.
Definition at line 688 of file ezmysqldb.php.
| eZMySQLDB::removeDatabase | ( | $ | dbName | ) | [virtual] |
| eZMySQLDB::removeRelation | ( | $ | relationName, |
| $ | relationType | ||
| ) | [virtual] |
Tries to remove the relation type $relationType named $relationName
true if successful Implements eZDBInterface.
Definition at line 693 of file ezmysqldb.php.
| eZMySQLDB::rollbackQuery | ( | ) |
The query to cancel the transaction.
Reimplemented from eZDBInterface.
Definition at line 762 of file ezmysqldb.php.
| eZMySQLDB::setError | ( | ) | [virtual] |
Sets the error message and error message number
Implements eZDBInterface.
Definition at line 817 of file ezmysqldb.php.
Referenced by checkCharsetPriv(), connect(), createDatabase(), query(), and removeDatabase().
| eZMySQLDB::subString | ( | $ | string, |
| $ | from, | ||
| $ | len = null |
||
| ) | [virtual] |
Implements eZDBInterface.
Definition at line 561 of file ezmysqldb.php.
| eZMySQLDB::supportedRelationTypeMask | ( | ) | [virtual] |
Implements eZDBInterface.
Definition at line 593 of file ezmysqldb.php.
| eZMySQLDB::supportedRelationTypes | ( | ) | [virtual] |
Implements eZDBInterface.
Definition at line 598 of file ezmysqldb.php.
| eZMySQLDB::supportsDefaultValuesInsertion | ( | ) |
Reimplemented from eZDBInterface.
Definition at line 901 of file ezmysqldb.php.
| eZMySQLDB::unlock | ( | ) | [virtual] |
| eZMySQLDB::$CharsetMapping |
Definition at line 912 of file ezmysqldb.php.
| eZMySQLDB::$TempTableList |
Definition at line 913 of file ezmysqldb.php.