Chuyển đến nội dung
Tài liệu

Tra cứu lớp và hàm

DB

Danh sách các phương thức công khai của lớp Zittme\Framework\DB. Tài liệu này được tạo tự động từ mã nguồn lõi Zittme.

Nguồn: common/framework/DB.php

Phương thức công khai

  • static function getInstance(string $type = 'master')
  • Get a singleton instance of the DB class.
  • function __construct(string $type, array $config)
  • Constructor.
  • function connect(array $config)
  • Connect to the database.
  • function disconnect()
  • Disconnect from the database.
  • function getHandle()
  • Get the PDO handle for direct manipulation.
  • function prepare(string $statement, array $driver_options = [])
  • Create a prepared statement.
  • function query(string $query_string, ...$args)
  • Execute a query string with or without parameters.
  • function executeQuery(string $query_id, $args = [], array $column_list = [], string $result_type = 'auto', string $result_class = '')
  • Execute an XML-defined query.
  • function fetch($stmt, int $last_index = 0, string $result_type = 'auto', string $result_class = '')
  • Fetch results from a query.
  • function beginTransaction()
  • Alias to begin().
  • function begin()
  • Begin a transaction.
  • function rollback()
  • Roll back a transaction.
  • function commit()
  • Commit a transaction.
  • function getTransactionLevel()
  • Get the current transaction level.
  • function getAffectedRows()
  • Get the number of rows affected by the last statement.
  • function getInsertID()
  • Get the auto-incremented ID generated by the last statement.
  • function getNextSequence()
  • Get the next global sequence value.
  • function isValidOldPassword(string $password, string $saved_password)
  • Check if a password is valid according to MySQL's old password hashing algorithm.
  • function isTableExists(string $table_name)
  • Check if a table exists.
  • function createTable(string $filename = '', string $content = '')
  • Create a table.
  • function dropTable(string $table_name)
  • Drop a table.
  • function isColumnExists(string $table_name, string $column_name)
  • Check if a column exists.
  • function addColumn(string $table_name, string $column_name, string $type = 'number', $size = null, $default = null, $notnull = false, $after_column = null)
  • Add a column.
  • function modifyColumn(string $table_name, string $column_name, string $type = 'number', $size = null, $default = null, $notnull = false, $after_column = null, $new_name = null, $new_charset = null)
  • Modify a column.
  • function dropColumn(string $table_name, string $column_name)
  • Drop a column.
  • function getColumnInfo(string $table_name, string $column_name)
  • Get column information.
  • function isIndexExists(string $table_name, string $index_name)
  • Check if an index exists.
  • function addIndex(string $table_name, string $index_name, $columns, $type = '', $options = '')
  • Add an index.
  • function dropIndex(string $table_name, string $index_name)
  • Drop an index.
  • function getIndexInfo(string $table_name, string $index_name)
  • Get index information.
  • function addPrefixes(string $query_string)
  • Add table prefixes to a query string.
  • function addQuotes($str)
  • Escape a string according to current DB settings.
  • function getBestSupportedCharset()
  • Find out the best supported character set.
  • function isError()
  • Check if the last statement produced an error.
  • function getError()
  • Get the last error information.
  • function setError(int $errno = 0, string $errstr = 'success')
  • Set error information to instance properties.
  • function clearError()
  • Clear error information.
  • function getQueryLog(string $query, float $elapsed_time)
  • Generate a query log entry.
  • function setQueryLog(array $log)
  • Send an entry to the query log for debugging.
  • function addElapsedTime(float $elapsed_time)
  • Add elapsed time.
  • function getQueryElapsedTime()
  • Get total time spent during queries.
  • function getTotalElapsedTime()
  • Get total time spent in this class.
  • function setDebugComment(bool $enabled)
  • Enable or disable debug comments.
  • function __get(string $key)
  • Magic method to support some read-only properties for backward compatibility.
  • function _query($query_string)
  • Execute a literal query string.
  • function _fetch($stmt, int $last_index = 0)
  • Fetch results from a query.
  • static function create()
  • Old alias to getInstance().
  • function db_fetch_object(\PDOStatement $stmt)
  • Old alias to $stmt->fetchObject().
  • function db_free_result(\PDOStatement $stmt)
  • Old alias to $stmt->closeCursor().
  • function db_insert_id()
  • Old alias to getInsertID().
  • static function getSupportedList()
  • Get the list of supported database drivers.
  • static function getEnableList()
  • Get the list of enabled database drivers.
  • static function getDisableList()
  • Get the list of disabled database drivers.
  • function isSupported()
  • Check if the current instance is supported.
  • function isConnected()
  • Check if the current instance is connected.
  • function close()
  • Close the DB connection.
  • function createTableByXmlFile($filename)
  • Methods related to table creation.
  • function createTableByXml($xml_doc)
  • function _createTable($xml_doc)
  • function getCountCache()
  • Methods related to the click count cache feature.
  • function putCountCache()
  • function resetCountCache()
  • function getParser()
  • Other deprecated methods.
  • function _getSlaveConnectionStringIndex()
  • function _getConnection()
  • function _dbInfoExists()