Merge "Added a separate error message for mkdir failures"
[lhc/web/wiklou.git] / includes / db / ORAField.php
1 <?php
2
3 use Wikimedia\Rdbms\Field;
4
5 class ORAField implements Field {
6 private $name, $tablename, $default, $max_length, $nullable,
7 $is_pk, $is_unique, $is_multiple, $is_key, $type;
8
9 function __construct( $info ) {
10 $this->name = $info['column_name'];
11 $this->tablename = $info['table_name'];
12 $this->default = $info['data_default'];
13 $this->max_length = $info['data_length'];
14 $this->nullable = $info['not_null'];
15 $this->is_pk = isset( $info['prim'] ) && $info['prim'] == 1 ? 1 : 0;
16 $this->is_unique = isset( $info['uniq'] ) && $info['uniq'] == 1 ? 1 : 0;
17 $this->is_multiple = isset( $info['nonuniq'] ) && $info['nonuniq'] == 1 ? 1 : 0;
18 $this->is_key = ( $this->is_pk || $this->is_unique || $this->is_multiple );
19 $this->type = $info['data_type'];
20 }
21
22 function name() {
23 return $this->name;
24 }
25
26 function tableName() {
27 return $this->tablename;
28 }
29
30 function defaultValue() {
31 return $this->default;
32 }
33
34 function maxLength() {
35 return $this->max_length;
36 }
37
38 function isNullable() {
39 return $this->nullable;
40 }
41
42 function isKey() {
43 return $this->is_key;
44 }
45
46 function isMultipleKey() {
47 return $this->is_multiple;
48 }
49
50 function type() {
51 return $this->type;
52 }
53 }