PHP Класс Solar_Sql_Adapter_Mysql, php-framework-benchmarks

Автор: Paul M. Jones ([email protected])
Наследование: extends Solar_Sql_Adapter
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_ident_quote_prefix string The quote character before an entity name (table, index, etc).
$_ident_quote_suffix string The quote character after an entity name (table, index, etc).
$_native_solar array Note that fetchTableCols() will programmatically convert TINYINT(1) to 'bool' independent of this map.
$_pdo_type string The PDO adapter type.
$_solar_native array Map of Solar generic types to RDBMS native types used when creating portable tables.

Защищенные методы

Метод Описание
_buildDsn ( array $info ) : string Creates a PDO-style DSN.
_createSequence ( string $name, integer $start = 1 ) : void Creates a sequence, optionally starting at a certain number.
_dropIndex ( string $table, string $name ) : void Drops an index.
_dropSequence ( string $name ) : void Drops a sequence.
_fetchIndexInfo ( string $table, string $schema ) : array Returns an array of index information for a table.
_fetchTableCols ( string $table, string $schema ) : array Returns an array describing the columns in a table.
_fetchTableList ( string $schema ) : array Returns a list of all tables in the database.
_getDefault ( string $default ) : scalar Given a native column SQL default value, finds a PHP literal value.
_modAutoincPrimary ( &$coldef, boolean $autoinc, boolean $primary ) : void Given a column definition, modifies the auto-increment and primary-key clauses in place.
_modSequenceName ( string $name ) : string Modifies the sequence name.
_nextSequence ( string $name ) : integer Gets a sequence number; creates the sequence if it does not exist.
_selectSingleFrom ( array $from ) : string Builds the FROM clause for a SELECT command; wraps it in parentheses to force precedence for MySQL.
_sqlCreateTable ( string $name, string $cols ) : string Builds a CREATE TABLE command string.

Описание методов

_buildDsn() защищенный Метод

For example, "mysql:host=127.0.0.1;dbname=test"
protected _buildDsn ( array $info ) : string
$info array An array with host, post, name, etc. keys.
Результат string A PDO-style DSN.

_createSequence() защищенный Метод

Creates a sequence, optionally starting at a certain number.
protected _createSequence ( string $name, integer $start = 1 ) : void
$name string The sequence name to create.
$start integer The first sequence number to return.
Результат void

_dropIndex() защищенный Метод

Drops an index.
protected _dropIndex ( string $table, string $name ) : void
$table string The table of the index.
$name string The full index name.
Результат void

_dropSequence() защищенный Метод

Drops a sequence.
protected _dropSequence ( string $name ) : void
$name string The sequence name to drop.
Результат void

_fetchIndexInfo() защищенный Метод

Returns an array of index information for a table.
protected _fetchIndexInfo ( string $table, string $schema ) : array
$table string The table name to fetch indexes for.
$schema string The database in which the table resides.
Результат array An array of table indexes.

_fetchTableCols() защищенный Метод

Returns an array describing the columns in a table.
protected _fetchTableCols ( string $table, string $schema ) : array
$table string The table name to fetch columns for.
$schema string The database in which the table resides.
Результат array An array of table column information.

_fetchTableList() защищенный Метод

Returns a list of all tables in the database.
protected _fetchTableList ( string $schema ) : array
$schema string Fetch tbe list of tables in this database; when empty, uses the current database.
Результат array All table names in the database.

_getDefault() защищенный Метод

SQL NULLs are converted to PHP nulls. Non-literal values (such as keywords and functions) are also returned as null.
protected _getDefault ( string $default ) : scalar
$default string The column default SQL value.
Результат scalar A literal PHP value.

_modAutoincPrimary() защищенный Метод

Given a column definition, modifies the auto-increment and primary-key clauses in place.
protected _modAutoincPrimary ( &$coldef, boolean $autoinc, boolean $primary ) : void
$autoinc boolean Whether or not this is an auto-increment column.
$primary boolean Whether or not this is a primary-key column.
Результат void

_modSequenceName() защищенный Метод

MySQL doesn't have sequences, so this adapter uses a table instead. This means we have to deconflict between "real" tables and tables being used for sequences, so this method appends "__s" to the sequnce name.
protected _modSequenceName ( string $name ) : string
$name string The requested sequence name.
Результат string The modified sequence name.

_nextSequence() защищенный Метод

Gets a sequence number; creates the sequence if it does not exist.
protected _nextSequence ( string $name ) : integer
$name string The sequence name.
Результат integer The next sequence number.

_selectSingleFrom() защищенный Метод

Builds the FROM clause for a SELECT command; wraps it in parentheses to force precedence for MySQL.
protected _selectSingleFrom ( array $from ) : string
$from array The array of FROM clause elements.
Результат string The FROM clause.

_sqlCreateTable() защищенный Метод

Builds a CREATE TABLE command string.
protected _sqlCreateTable ( string $name, string $cols ) : string
$name string The table name to create.
$cols string The column definitions.
Результат string A CREATE TABLE command string.

Описание свойств

$_ident_quote_prefix защищенное свойство

The quote character before an entity name (table, index, etc).
protected string $_ident_quote_prefix
Результат string

$_ident_quote_suffix защищенное свойство

The quote character after an entity name (table, index, etc).
protected string $_ident_quote_suffix
Результат string

$_native_solar защищенное свойство

Note that fetchTableCols() will programmatically convert TINYINT(1) to 'bool' independent of this map.
См. также: fetchTableCols()
protected array $_native_solar
Результат array

$_pdo_type защищенное свойство

The PDO adapter type.
protected string $_pdo_type
Результат string

$_solar_native защищенное свойство

Map of Solar generic types to RDBMS native types used when creating portable tables.
protected array $_solar_native
Результат array