PHP Class Prado\Data\Common\TDbMetaData

Use the {@link getTableInfo} method to retrieve a table information.
Since: 3.1
Inheritance: extends Prado\TComponent
Show file Open project: pradosoft/prado Class Usage Examples

Protected Properties

Property Type Description
$delimiterIdentifier array

Public Methods

Method Description
__construct ( $conn )
createCommandBuilder ( $tableName = null ) : TDbCommandBuilder Creates a command builder for a given table name.
findTableNames ( string $schema = '' ) : array Returns all table names in the database.
getDbConnection ( ) : TDbConnection
getInstance ( $conn ) : TDbMetaData Obtain database specific TDbMetaData class using the driver name of the database connection.
getTableInfo ( $tableName = null ) : TDbTableInfo Obtains table meta data information for the current connection and given table name.
quoteColumnAlias ( string $name ) : string Quotes a column alias for use in a query.
quoteColumnName ( string $name ) : string Quotes a column name for use in a query.
quoteTableName ( string $name ) : string Quotes a table name for use in a query.

Protected Methods

Method Description
createTableInfo ( $tableName ) : TDbTableInfo This method should be implemented by decendent classes.
getTableInfoClass ( ) : string

Method Details

__construct() public method

public __construct ( $conn )

createCommandBuilder() public method

Creates a command builder for a given table name.
public createCommandBuilder ( $tableName = null ) : TDbCommandBuilder
return TDbCommandBuilder command builder instance for the given table.

createTableInfo() abstract protected method

This method should be implemented by decendent classes.
abstract protected createTableInfo ( $tableName ) : TDbTableInfo
return TDbTableInfo driver dependent create builder.

findTableNames() abstract public method

This method should be overridden by child classes in order to support this feature because the default implementation simply throws an exception.
abstract public findTableNames ( string $schema = '' ) : array
$schema string the schema of the tables. Defaults to empty string, meaning the current or default schema. If not empty, the returned table names will be prefixed with the schema name.
return array all table names in the database.

getDbConnection() public method

public getDbConnection ( ) : TDbConnection
return TDbConnection database connection.

getInstance() public static method

Obtain database specific TDbMetaData class using the driver name of the database connection.
public static getInstance ( $conn ) : TDbMetaData
return TDbMetaData database specific TDbMetaData.

getTableInfo() public method

Obtains table meta data information for the current connection and given table name.
public getTableInfo ( $tableName = null ) : TDbTableInfo
return TDbTableInfo table information.

getTableInfoClass() protected method

protected getTableInfoClass ( ) : string
return string TDbTableInfo class name.

quoteColumnAlias() public method

Quotes a column alias for use in a query.
public quoteColumnAlias ( string $name ) : string
$name string column alias
return string the properly quoted column alias

quoteColumnName() public method

Quotes a column name for use in a query.
public quoteColumnName ( string $name ) : string
$name string column name
return string the properly quoted column name

quoteTableName() public method

Quotes a table name for use in a query.
public quoteTableName ( string $name ) : string
$name string table name
return string the properly quoted table name

Property Details

$delimiterIdentifier protected static property

protected static array $delimiterIdentifier
return array