From 42b9ea233241e6071552adee997d0de87f953e1f Mon Sep 17 00:00:00 2001 From: wei <> Date: Sat, 14 Apr 2007 05:03:19 +0000 Subject: Remove Vendor from ActiveRecord. Now uses Data/Common instead --- .../ActiveRecord/Vendor/TSqliteColumnMetaData.php | 147 --------------------- 1 file changed, 147 deletions(-) delete mode 100644 framework/Data/ActiveRecord/Vendor/TSqliteColumnMetaData.php (limited to 'framework/Data/ActiveRecord/Vendor/TSqliteColumnMetaData.php') diff --git a/framework/Data/ActiveRecord/Vendor/TSqliteColumnMetaData.php b/framework/Data/ActiveRecord/Vendor/TSqliteColumnMetaData.php deleted file mode 100644 index 8f4ded39..00000000 --- a/framework/Data/ActiveRecord/Vendor/TSqliteColumnMetaData.php +++ /dev/null @@ -1,147 +0,0 @@ - - * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2007 PradoSoft - * @license http://www.pradosoft.com/license/ - * @version $Id$ - * @package System.Data.ActiveRecord.Vendor - */ - -/** - * TSqliteColumnMetaData class. - * - * Column details for SQLite version 2.x or 3.x. database. - * - * @author Wei Zhuo - * @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; - private $_property; - private $_length; - - public function __construct($property,$name,$type,$notNull,$autoIncrement,$default,$primary) - { - $this->_property=$property; - $this->_name=$name; - $this->_notNull=$notNull; - $this->_autoIncrement=$autoIncrement; - $this->_default=$default; - $this->_primary=$primary; - $this->processType($type); - } - - protected function processType($type) - { - if(is_int($pos=strpos($type, '('))) - { - $match=array(); - if(preg_match('/\((.*)\)/', $type, $match)) - { - $this->_length=floatval($match[1]); - $this->_type = substr($type,0,$pos); - } - else - $this->_type = $type; - } - else - $this->_type = $type; - } - - public function getLength() - { - return $this->_length; - } - - public function getPHPType() - { - switch(strtolower($this->_type)) - { - case 'int': case 'integer': case 'mediumint': case 'smallint': case 'tinyint': case 'year': - return 'integer'; - case 'boolean': - return 'boolean'; - case 'decimal': case 'double': case 'float': case 'bigint': - return 'float'; - default: - return 'string'; - } - } - - /** - * @return string column name, used as active record property name - */ - public function getProperty() - { - return $this->_property; - } - - /** - * @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 -- cgit v1.2.3