summaryrefslogtreecommitdiff
path: root/www/wiki/includes/libs/rdbms/field/MssqlField.php
blob: 98cc2b189338c189a91b2042306ce10ed5d72145 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php

namespace Wikimedia\Rdbms;

class MssqlField implements Field {
	private $name, $tableName, $default, $max_length, $nullable, $type;

	function __construct( $info ) {
		$this->name = $info['COLUMN_NAME'];
		$this->tableName = $info['TABLE_NAME'];
		$this->default = $info['COLUMN_DEFAULT'];
		$this->max_length = $info['CHARACTER_MAXIMUM_LENGTH'];
		$this->nullable = !( strtolower( $info['IS_NULLABLE'] ) == 'no' );
		$this->type = $info['DATA_TYPE'];
	}

	function name() {
		return $this->name;
	}

	function tableName() {
		return $this->tableName;
	}

	function defaultValue() {
		return $this->default;
	}

	function maxLength() {
		return $this->max_length;
	}

	function isNullable() {
		return $this->nullable;
	}

	function type() {
		return $this->type;
	}
}