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
16
public
function
name
() {
17
return
$this->info->name;
18
}
19
20
public
function
tableName
() {
21
return
$this->tableName;
22
}
23
24
public
function
defaultValue
() {
25
if
( is_string( $this->info->dflt_value ) ) {
26
// Typically quoted
27
if
( preg_match(
'/^\'(.*)\'$/'
, $this->info->dflt_value,
$matches
) ) {
28
return
str_replace(
"''"
,
"'"
,
$matches
[1] );
29
}
30
}
31
32
return
$this->info->dflt_value;
33
}
34
38
public
function
isNullable
() {
39
return
!$this->info->notnull;
40
}
41
42
public
function
type
() {
43
return
$this->info->type;
44
}
45
}
$matches
$matches
Definition
NoLocalSettings.php:27
Wikimedia\Rdbms\SQLiteField
Definition
SQLiteField.php:7
Wikimedia\Rdbms\SQLiteField\type
type()
Database type.
Definition
SQLiteField.php:42
Wikimedia\Rdbms\SQLiteField\tableName
tableName()
Name of table this field belongs to.
Definition
SQLiteField.php:20
Wikimedia\Rdbms\SQLiteField\defaultValue
defaultValue()
Definition
SQLiteField.php:24
Wikimedia\Rdbms\SQLiteField\name
name()
Field name.
Definition
SQLiteField.php:16
Wikimedia\Rdbms\SQLiteField\isNullable
isNullable()
Definition
SQLiteField.php:38
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 Sat Jul 27 2024 00:23:41 for MediaWiki by
1.10.0