Subversion-Projekte lars-tiefland.prado

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/**
3
 * TMysqlTableInfo class file.
4
 *
5
 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
6
 * @link http://www.pradosoft.com/
7
 * @copyright Copyright &copy; 2005-2008 PradoSoft
8
 * @license http://www.pradosoft.com/license/
9
 * @version $Id: TMysqlTableInfo.php 2482 2008-07-30 02:07:13Z knut $
10
 * @package System.Data.Common.Mysql
11
 */
12
 
13
/**
14
 * Loads the base TDbTableInfo class and TMysqlTableColumn class.
15
 */
16
Prado::using('System.Data.Common.TDbTableInfo');
17
Prado::using('System.Data.Common.Mysql.TMysqlTableColumn');
18
 
19
/**
20
 * TMysqlTableInfo class provides additional table information for MySQL database.
21
 *
22
 * @author Wei Zhuo <weizho[at]gmail[dot]com>
23
 * @version $Id: TMysqlTableInfo.php 2482 2008-07-30 02:07:13Z knut $
24
 * @package System.Data.Common.Mysql
25
 * @since 3.1
26
 */
27
class TMysqlTableInfo extends TDbTableInfo
28
{
29
	/**
30
	 * @return string name of the schema this column belongs to.
31
	 */
32
	public function getSchemaName()
33
	{
34
		return $this->getInfo('SchemaName');
35
	}
36
 
37
	/**
38
	 * @return string full name of the table, database dependent.
39
	 */
40
	public function getTableFullName()
41
	{
42
		if(($schema=$this->getSchemaName())!==null)
43
			return '`'.$schema.'`.`'.$this->getTableName().'`';
44
		else
45
			return '`'.$this->getTableName().'`';
46
	}
47
 
48
	/**
49
	 * @param TDbConnection database connection.
50
	 * @return TDbCommandBuilder new command builder
51
	 */
52
	public function createCommandBuilder($connection)
53
	{
54
		Prado::using('System.Data.Common.Mysql.TMysqlCommandBuilder');
55
		return new TMysqlCommandBuilder($connection,$this);
56
	}
57
}
58
 
59
?>