Merge "Convert Special:DeletedContributions to use OOUI."
[lhc/web/wiklou.git] / includes / libs / rdbms / field / SQLiteField.php
1 <?php
2 class SQLiteField implements Field {
3 private $info, $tableName;
4
5 function __construct( $info, $tableName ) {
6 $this->info = $info;
7 $this->tableName = $tableName;
8 }
9
10 function name() {
11 return $this->info->name;
12 }
13
14 function tableName() {
15 return $this->tableName;
16 }
17
18 function defaultValue() {
19 if ( is_string( $this->info->dflt_value ) ) {
20 // Typically quoted
21 if ( preg_match( '/^\'(.*)\'$', $this->info->dflt_value ) ) {
22 return str_replace( "''", "'", $this->info->dflt_value );
23 }
24 }
25
26 return $this->info->dflt_value;
27 }
28
29 /**
30 * @return bool
31 */
32 function isNullable() {
33 return !$this->info->notnull;
34 }
35
36 function type() {
37 return $this->info->type;
38 }
39 }