summaryrefslogtreecommitdiff
path: root/framework/Data/ActiveRecord/Vendor/TSqliteColumnMetaData.php
diff options
context:
space:
mode:
authorwei <>2006-11-26 22:15:58 +0000
committerwei <>2006-11-26 22:15:58 +0000
commita8b3ebe8f62c3888b216d827c1c5dcba8a47d4e1 (patch)
tree5eef79dbc5e2f506047fa463cb427a40a7bd8441 /framework/Data/ActiveRecord/Vendor/TSqliteColumnMetaData.php
parent6773dfe453682d2b39a26fbabef8e706bf6bb412 (diff)
Adding active record implementation.
Diffstat (limited to 'framework/Data/ActiveRecord/Vendor/TSqliteColumnMetaData.php')
-rw-r--r--framework/Data/ActiveRecord/Vendor/TSqliteColumnMetaData.php96
1 files changed, 96 insertions, 0 deletions
diff --git a/framework/Data/ActiveRecord/Vendor/TSqliteColumnMetaData.php b/framework/Data/ActiveRecord/Vendor/TSqliteColumnMetaData.php
new file mode 100644
index 00000000..94029cfa
--- /dev/null
+++ b/framework/Data/ActiveRecord/Vendor/TSqliteColumnMetaData.php
@@ -0,0 +1,96 @@
+<?php
+/**
+ * TSqliteColumnMetaData class file.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @version $Id$
+ * @package System.Data.ActiveRecord.Vendor
+ */
+
+/**
+ * TSqliteColumnMetaData class.
+ *
+ * Column details for SQLite version 2.x or 3.x. database.
+ *
+ * @author Wei Zhuo <weizho[at]gmail[dot]com>
+ * @version $Id$
+ * @package System.Data.ActiveRecord.Vendor
+ * @since 3.1
+ */
+class TSqliteColumnMetaData extends TComponent
+{
+ private $_name;
+ private $_type;
+ private $_notNull;
+ private $_autoIncrement;
+ private $_default;
+ private $_primary=false;
+
+ public function __construct($name,$type,$notNull,$autoIncrement,$default,$primary)
+ {
+ $this->_name=$name;
+ $this->_type=$type;
+ $this->_notNull=$notNull;
+ $this->_autoIncrement=$autoIncrement;
+ $this->_default=$default;
+ $this->_primary=$primary;
+ }
+
+ /**
+ * @return string quoted column name.
+ */
+ public function getName()
+ {
+ return $this->_name;
+ }
+
+ /**
+ * @return boolean true if column is a sequence, false otherwise.
+ */
+ public function hasSequence()
+ {
+ return $this->_autoIncrement;
+ }
+
+ /**
+ * @return null no sequence name.
+ */
+ public function getSequenceName()
+ {
+ return null;
+ }
+
+ /**
+ * @return boolean true if the column is a primary key, or part of a composite primary key.
+ */
+ public function getIsPrimaryKey()
+ {
+ return $this->_primary;
+ }
+
+ public function getType()
+ {
+ return $this->_type;
+ }
+
+
+ public function getNotNull()
+ {
+ return $this->_notNull;
+ }
+
+ /**
+ * @return boolean true if column has default value, false otherwise.
+ */
+ public function hasDefault()
+ {
+ return $this->_default !== null;
+ }
+
+ public function getDefaultValue()
+ {
+ return $this->_default;
+ }
+}
+
+?> \ No newline at end of file