Localisation updates from https://translatewiki.net.
[mediawiki.git] / includes / libs / rdbms / field / SQLiteField.php
blob0a2389bfb0a782ebad00b1a4ee795109ee8afd5f
1 <?php
2 class SQLiteField implements Field {
3 private $info, $tableName;
5 function __construct( $info, $tableName ) {
6 $this->info = $info;
7 $this->tableName = $tableName;
10 function name() {
11 return $this->info->name;
14 function tableName() {
15 return $this->tableName;
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 );
26 return $this->info->dflt_value;
29 /**
30 * @return bool
32 function isNullable() {
33 return !$this->info->notnull;
36 function type() {
37 return $this->info->type;