summaryrefslogtreecommitdiff
path: root/framework/Data/Common/Mssql
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Data/Common/Mssql')
-rw-r--r--framework/Data/Common/Mssql/TMssqlMetaData.php24
-rw-r--r--framework/Data/Common/Mssql/TMssqlTableColumn.php9
-rw-r--r--framework/Data/Common/Mssql/TMssqlTableInfo.php4
3 files changed, 37 insertions, 0 deletions
diff --git a/framework/Data/Common/Mssql/TMssqlMetaData.php b/framework/Data/Common/Mssql/TMssqlMetaData.php
index c70bc349..5d14aac1 100644
--- a/framework/Data/Common/Mssql/TMssqlMetaData.php
+++ b/framework/Data/Common/Mssql/TMssqlMetaData.php
@@ -1,4 +1,14 @@
<?php
+/**
+ * TMssqlMetaData class file.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2007 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id: TPgsqlMetaData.php 1866 2007-04-14 05:02:29Z wei $
+ * @package System.Data.Common.Pgsql
+ */
/**
* Load the base TDbMetaData class.
@@ -6,6 +16,14 @@
Prado::using('System.Data.Common.TDbMetaData');
Prado::using('System.Data.Common.Mssql.TMssqlTableInfo');
+/**
+ * TMssqlMetaData loads MSSQL database table and column information.
+ *
+ * @author Wei Zhuo <weizho[at]gmail[dot]com>
+ * @version $Id: TPgsqlMetaData.php 1866 2007-04-14 05:02:29Z wei $
+ * @package System.Data.Commom.Pgsql
+ * @since 3.1
+ */
class TMssqlMetaData extends TDbMetaData
{
/**
@@ -45,9 +63,15 @@ EOD;
$tableInfo = $this->createNewTableInfo($col);
$this->processColumn($tableInfo,$col);
}
+ if($tableInfo===null)
+ throw new TDbException('dbmetadata_invalid_table_view', $table);
return $tableInfo;
}
+ /**
+ * @param string table name
+ * @return array tuple($catalogName,$schemaName,$tableName)
+ */
protected function getCatalogSchemaTableName($table)
{
//remove possible delimiters
diff --git a/framework/Data/Common/Mssql/TMssqlTableColumn.php b/framework/Data/Common/Mssql/TMssqlTableColumn.php
index 77c115e5..f108248d 100644
--- a/framework/Data/Common/Mssql/TMssqlTableColumn.php
+++ b/framework/Data/Common/Mssql/TMssqlTableColumn.php
@@ -37,16 +37,25 @@ class TMssqlTableColumn extends TDbTableColumn
return 'string';
}
+ /**
+ * @return boolean true if the column has identity (auto-increment)
+ */
public function getAutoIncrement()
{
return $this->getInfo('AutoIncrement',false);
}
+ /**
+ * @return boolean true if auto increments.
+ */
public function hasSequence()
{
return $this->getAutoIncrement();
}
+ /**
+ * @return boolean true if db type is 'timestamp'.
+ */
public function getIsExcluded()
{
return strtolower($this->getDbType())==='timestamp';
diff --git a/framework/Data/Common/Mssql/TMssqlTableInfo.php b/framework/Data/Common/Mssql/TMssqlTableInfo.php
index b407ad44..e408440b 100644
--- a/framework/Data/Common/Mssql/TMssqlTableInfo.php
+++ b/framework/Data/Common/Mssql/TMssqlTableInfo.php
@@ -34,6 +34,9 @@ class TMssqlTableInfo extends TDbTableInfo
return $this->getInfo('SchemaName');
}
+ /**
+ * @return string catalog name (database name)
+ */
public function getCatalogName()
{
return $this->getInfo('CatalogName');
@@ -44,6 +47,7 @@ class TMssqlTableInfo extends TDbTableInfo
*/
public function getTableFullName()
{
+ //MSSQL alway returns the catalog, schem and table names.
return '['.$this->getCatalogName().'].['.$this->getSchemaName().'].['.$this->getTableName().']';
}