]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/framework/Data/Common/Mysql/TMysqlTableInfo.php
Add Baculum
[bacula/bacula] / gui / baculum / framework / Data / Common / Mysql / TMysqlTableInfo.php
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-2013 PradoSoft
8  * @license http://www.pradosoft.com/license/
9  * @version $Id: TMysqlTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
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 3245 2013-01-07 20:23:32Z ctrlaltca $
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