PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TMysqlMetaData

TMysqlMetaData loads Mysql version 4.1.x and 5.x database table and column information.

For Mysql version 4.1.x, PHP 5.1.3 or later is required. See http://netevil.org/node.php?nid=795&SC=1

TComponent
Extended by TDbMetaData
Extended by TMysqlMetaData
Package: System\Data\Common\Mysql
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Wei Zhuo <weizho[at]gmail[dot]com>
Since: 3.1
Located at Data/Common/Mysql/TMysqlMetaData.php
Methods summary
protected string
# getTableInfoClass( )

Returns

string
TDbTableInfo class name.

Overrides

TDbMetaData::getTableInfoClass()
public string
# quoteTableName( string $name )

Quotes a table name for use in a query.

Quotes a table name for use in a query.

Parameters

$name
string
$name table name

Returns

string
the properly quoted table name

Overrides

TDbMetaData::quoteTableName()
public string
# quoteColumnName( string $name )

Quotes a column name for use in a query.

Quotes a column name for use in a query.

Parameters

$name
string
$name column name

Returns

string
the properly quoted column name

Overrides

TDbMetaData::quoteColumnName()
public string
# quoteColumnAlias( string $name )

Quotes a column alias for use in a query.

Quotes a column alias for use in a query.

Parameters

$name
string
$name column alias

Returns

string
the properly quoted column alias

Overrides

TDbMetaData::quoteColumnAlias()
protected TMysqlTableInfo
# createTableInfo( string $table )

Get the column definitions for given table.

Get the column definitions for given table.

Parameters

$table
string
table name.

Returns

TMysqlTableInfo
table information.
protected float
# getServerVersion( )

Returns

float
server version.
protected
# processColumn( TMysqlTableInfo $tableInfo, array $col )

Parameters

$tableInfo
TMysqlTableInfo
table information.
$col
array
column information.
protected boolean
# isPrecisionType( mixed $type )

Returns

boolean
true if column type if "numeric", "interval" or begins with "time".
protected boolean
# isEnumSetType( mixed $type )

Returns

boolean
true if column type if "enum" or "set".
protected array
# getSchemaTableName( string $table )

Parameters

$table
string
table name, may be quoted with back-ticks and may contain database name.

Returns

array
tuple ($schema,$table), $schema may be null.

Throws

TDbException
when table name contains invalid identifier bytes.
protected
# isValidIdentifier( string $name )

http://dev.mysql.com/doc/refman/5.0/en/identifiers.html

http://dev.mysql.com/doc/refman/5.0/en/identifiers.html

Parameters

$name
string
identifier name
protected TMysqlTableInfo
# createNewTableInfo( string $table )

Parameters

$table
string
table schema name

Returns

TMysqlTableInfo
protected boolean
# getIsView( string $schemaName, string $tableName )

For MySQL version 5.0.1 or later we can use SHOW FULL TABLES http://dev.mysql.com/doc/refman/5.0/en/show-tables.html

For MySQL version 5.0.1 or later we can use SHOW FULL TABLES http://dev.mysql.com/doc/refman/5.0/en/show-tables.html

For MySQL version 5.0.1 or ealier, this always return false.

Parameters

$schemaName
string
database name, null to use default connection database.
$tableName
string
table or view name.

Returns

boolean
true if is view, false otherwise.

Throws

TDbException
if table or view does not exist.
protected array
# getConstraintKeys( string $schemaName, string $tableName )

Gets the primary and foreign key column details for the given table.

Gets the primary and foreign key column details for the given table.

Parameters

$schemaName
string
schema name
$tableName
string
table name.

Returns

array
tuple ($primary, $foreign)
protected array
# getForeignConstraints( string $schemaName, string $tableName )

Gets foreign relationship constraint keys and table name

Gets foreign relationship constraint keys and table name

Parameters

$schemaName
string
database name
$tableName
string
table name

Returns

array
foreign relationship table name and keys.
protected string
# getShowCreateTable( string $schemaName, string $tableName )

Parameters

$schemaName
string
database name
$tableName
string
table name

Returns

string
SQL command to create the table.

Throws

TDbException
if PHP version is less than 5.1.3
protected array
# findForeignConstraints( string $schemaName, string $tableName )

Extract foreign key constraints by extracting the contraints from SHOW CREATE TABLE result.

Extract foreign key constraints by extracting the contraints from SHOW CREATE TABLE result.

Parameters

$schemaName
string
database name
$tableName
string
table name

Returns

array
foreign relationship table name and keys.
protected boolean
# isForeignKeyColumn( string $columnId, TPgsqlTableInfo $tableInfo )

Parameters

$columnId
string
column name.
$tableInfo
TPgsqlTableInfo
table information.

Returns

boolean
true if column is a foreign key.
public array
# findTableNames( string $schema = '' )

Returns all table names in the database.

Returns all table names in the database.

Parameters

$schema
string
$schema 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.

Returns

array
all table names in the database.
Methods inherited from TDbMetaData
__construct(), createCommandBuilder(), getDbConnection(), getInstance(), getTableInfo()
Methods inherited from TComponent
__call(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Properties inherited from TDbMetaData
$delimiterIdentifier
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO