summaryrefslogtreecommitdiff
path: root/www/wiki/includes/libs/rdbms/field/MssqlField.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/includes/libs/rdbms/field/MssqlField.php')
-rw-r--r--www/wiki/includes/libs/rdbms/field/MssqlField.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/www/wiki/includes/libs/rdbms/field/MssqlField.php b/www/wiki/includes/libs/rdbms/field/MssqlField.php
new file mode 100644
index 00000000..98cc2b18
--- /dev/null
+++ b/www/wiki/includes/libs/rdbms/field/MssqlField.php
@@ -0,0 +1,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;
+ }
+}