3 use Wikimedia\Rdbms\Field
;
5 class ORAField
implements Field
{
6 private $name, $tablename, $default, $max_length, $nullable,
7 $is_pk, $is_unique, $is_multiple, $is_key, $type;
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'];
26 function tableName() {
27 return $this->tablename
;
30 function defaultValue() {
31 return $this->default;
34 function maxLength() {
35 return $this->max_length
;
38 function isNullable() {
39 return $this->nullable
;
46 function isMultipleKey() {
47 return $this->is_multiple
;