PHP 클래스 Solar_Sql_Adapter_Mysql, php-framework-benchmarks

저자: Paul M. Jones ([email protected])
상속: extends Solar_Sql_Adapter
파일 보기 프로젝트 열기: pmjones/php-framework-benchmarks 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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