PHP Class yii\db\oci\Schema

Since: 2.0
Author: Qiang Xue ([email protected])
Inheritance: extends yii\db\Schema
Show file Open project: yiisoft/yii2 Class Usage Examples

Public Properties

Property Type Description
$exceptionMap map of DB errors and corresponding exceptions If left part is found in DB error message exception class from the right part is used.

Public Methods

Method Description
createColumnSchemaBuilder ( $type, $length = null )
createQueryBuilder ( )
findUniqueIndexes ( yii\db\TableSchema $table ) : array Returns all unique indexes for the given table.
getLastInsertID ( string $sequenceName = '' ) : string
init ( )
insert ( $table, $columns )
loadTableSchema ( $name )
quoteSimpleTableName ( $name )
releaseSavepoint ( $name )

Protected Methods

Method Description
createColumn ( array $column ) : ColumnSchema Creates ColumnSchema instance
extractColumnSize ( ColumnSchema $column, string $dbType, string $precision, string $scale, string $length ) Extracts size, precision and scale information from column's DB type.
extractColumnType ( ColumnSchema $column, string $dbType, string $precision, string $scale, string $length ) Extracts the data types for the given column
findColumns ( yii\db\TableSchema $table ) : boolean Collects the table column metadata.
findConstraints ( yii\db\TableSchema $table ) Finds constraints and fills them into TableSchema object passed
findSchemaNames ( )
findTableNames ( $schema = '' )
getTableSequenceName ( string $tableName ) : string | null Sequence name of table
resolveTableNames ( yii\db\TableSchema $table, string $name ) Resolves the table name and schema name (if any).

Method Details

createColumn() protected method

Creates ColumnSchema instance
protected createColumn ( array $column ) : ColumnSchema
$column array
return yii\db\ColumnSchema

createColumnSchemaBuilder() public method

public createColumnSchemaBuilder ( $type, $length = null )

createQueryBuilder() public method

public createQueryBuilder ( )

extractColumnSize() protected method

Extracts size, precision and scale information from column's DB type.
protected extractColumnSize ( ColumnSchema $column, string $dbType, string $precision, string $scale, string $length )
$column yii\db\ColumnSchema
$dbType string the column's DB type
$precision string total number of digits. This parameter is available since version 2.0.4.
$scale string number of digits on the right of the decimal separator. This parameter is available since version 2.0.4.
$length string length for character types. This parameter is available since version 2.0.4.

extractColumnType() protected method

Extracts the data types for the given column
protected extractColumnType ( ColumnSchema $column, string $dbType, string $precision, string $scale, string $length )
$column yii\db\ColumnSchema
$dbType string DB type
$precision string total number of digits. This parameter is available since version 2.0.4.
$scale string number of digits on the right of the decimal separator. This parameter is available since version 2.0.4.
$length string length for character types. This parameter is available since version 2.0.4.

findColumns() protected method

Collects the table column metadata.
protected findColumns ( yii\db\TableSchema $table ) : boolean
$table yii\db\TableSchema the table schema
return boolean whether the table exists

findConstraints() protected method

Finds constraints and fills them into TableSchema object passed
protected findConstraints ( yii\db\TableSchema $table )
$table yii\db\TableSchema

findSchemaNames() protected method

protected findSchemaNames ( )

findTableNames() protected method

protected findTableNames ( $schema = '' )

findUniqueIndexes() public method

Each array element is of the following structure: php [ 'IndexName1' => ['col1' [, ...]], 'IndexName2' => ['col2' [, ...]], ]
Since: 2.0.4
public findUniqueIndexes ( yii\db\TableSchema $table ) : array
$table yii\db\TableSchema the table metadata
return array all unique indexes for the given table.

getLastInsertID() public method

See also: http://www.php.net/manual/en/function.PDO-lastInsertId.php -> Oracle does not support this Returns the ID of the last inserted row or sequence value.
public getLastInsertID ( string $sequenceName = '' ) : string
$sequenceName string name of the sequence object (required by some DBMS)
return string the row ID of the last row inserted, or the last value retrieved from the sequence object

getTableSequenceName() protected method

Sequence name of table
protected getTableSequenceName ( string $tableName ) : string | null
$tableName string
return string | null whether the sequence exists

init() public method

public init ( )

insert() public method

public insert ( $table, $columns )

loadTableSchema() public method

public loadTableSchema ( $name )

quoteSimpleTableName() public method

public quoteSimpleTableName ( $name )

releaseSavepoint() public method

public releaseSavepoint ( $name )

resolveTableNames() protected method

Resolves the table name and schema name (if any).
protected resolveTableNames ( yii\db\TableSchema $table, string $name )
$table yii\db\TableSchema the table metadata object
$name string the table name

Property Details

$exceptionMap public property

map of DB errors and corresponding exceptions If left part is found in DB error message exception class from the right part is used.
public $exceptionMap