MediaWiki
master
SQLiteField.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Wikimedia\Rdbms
;
4
5
use stdClass;
6
7
class
SQLiteField
implements
Field
{
8
private
stdClass $info;
9
private
string
$tableName;
10
11
public
function
__construct
( stdClass $info,
string
$tableName ) {
12
$this->info = $info;
13
$this->
tableName
= $tableName;
14
}
15
17
public
function
name
() {
18
return
$this->info->name;
19
}
20
22
public
function
tableName
() {
23
return
$this->tableName;
24
}
25
29
public
function
defaultValue
() {
30
if
( is_string( $this->info->dflt_value ) ) {
31
// Typically quoted
32
if
( preg_match(
'/^\'(.*)\'$/'
, $this->info->dflt_value,
$matches
) ) {
33
return
str_replace(
"''"
,
"'"
,
$matches
[1] );
34
}
35
}
36
37
return
$this->info->dflt_value;
38
}
39
43
public
function
isNullable
() {
44
return
!$this->info->notnull;
45
}
46
48
public
function
type
() {
49
return
$this->info->type;
50
}
51
}
$matches
$matches
Definition
NoLocalSettings.php:13
Wikimedia\Rdbms\SQLiteField
Definition
SQLiteField.php:7
Wikimedia\Rdbms\SQLiteField\type
type()
Database type.string
Definition
SQLiteField.php:48
Wikimedia\Rdbms\SQLiteField\tableName
tableName()
Name of table this field belongs to.string
Definition
SQLiteField.php:22
Wikimedia\Rdbms\SQLiteField\defaultValue
defaultValue()
Definition
SQLiteField.php:29
Wikimedia\Rdbms\SQLiteField\name
name()
Field name.string
Definition
SQLiteField.php:17
Wikimedia\Rdbms\SQLiteField\isNullable
isNullable()
Definition
SQLiteField.php:43
Wikimedia\Rdbms\SQLiteField\__construct
__construct(stdClass $info, string $tableName)
Definition
SQLiteField.php:11
Wikimedia\Rdbms\Field
Base for all database-specific classes representing information about database fields.
Definition
Field.php:9
Wikimedia\Rdbms
Definition
ChangedTablesTracker.php:3
includes
libs
Rdbms
Field
SQLiteField.php
Generated on Fri Jan 23 2026 03:25:15 for MediaWiki by
1.10.0