Subversion-Projekte lars-tiefland.prado

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/**
3
 * TSqliteTableColumn 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: TSqliteTableColumn.php 1861 2007-04-12 08:05:03Z wei $
10
 * @package System.Data.Common.Sqlite
11
 */
12
 
13
/**
14
 * Load common TDbTableCommon class.
15
 */
16
Prado::using('System.Data.Common.TDbTableColumn');
17
 
18
/**
19
 * Describes the column metadata of the schema for a PostgreSQL database table.
20
 *
21
 * @author Wei Zhuo <weizho[at]gmail[dot]com>
22
 * @version $Id: TSqliteTableColumn.php 1861 2007-04-12 08:05:03Z wei $
23
 * @package System.Data.Common.Sqlite
24
 * @since 3.1
25
 */
26
class TSqliteTableColumn extends TDbTableColumn
27
{
28
	/**
29
	 * @TODO add sqlite types.
30
	 */
31
	private static $types = array();
32
 
33
	/**
34
	 * Overrides parent implementation, returns PHP type from the db type.
35
	 * @return boolean derived PHP primitive type from the column db type.
36
	 */
37
	public function getPHPType()
38
	{
39
		$dbtype = strtolower($this->getDbType());
40
		foreach(self::$types as $type => $dbtypes)
41
		{
42
			if(in_array($dbtype, $dbtypes))
43
				return $type;
44
		}
45
		return 'string';
46
	}
47
 
48
	/**
49
	 * @return boolean true if column will auto-increment when the column value is inserted as null.
50
	 */
51
	public function getAutoIncrement()
52
	{
53
		return $this->getInfo('AutoIncrement', false);
54
	}
55
 
56
	/**
57
	 * @return boolean true if auto increment is true.
58
	 */
59
	public function hasSequence()
60
	{
61
		return $this->getAutoIncrement();
62
	}
63
}
64