]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/libs/rdbms/field/MssqlField.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / includes / libs / rdbms / field / MssqlField.php
diff --git a/includes/libs/rdbms/field/MssqlField.php b/includes/libs/rdbms/field/MssqlField.php
new file mode 100644 (file)
index 0000000..98cc2b1
--- /dev/null
@@ -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;
+       }
+}