MediaWiki  REL1_31
ORAField.php
Go to the documentation of this file.
1 <?php
2 
4 
5 class ORAField implements Field {
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 }
ORAField\$tablename
$tablename
Definition: ORAField.php:6
ORAField\isNullable
isNullable()
Whether this field can store NULL values.
Definition: ORAField.php:38
use
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
Definition: APACHE-LICENSE-2.0.txt:10
ORAField\name
name()
Field name.
Definition: ORAField.php:22
ORAField\$is_multiple
$is_multiple
Definition: ORAField.php:7
ORAField
Definition: ORAField.php:5
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:37
ORAField\maxLength
maxLength()
Definition: ORAField.php:34
ORAField\__construct
__construct( $info)
Definition: ORAField.php:9
ORAField\$nullable
$nullable
Definition: ORAField.php:6
ORAField\type
type()
Database type.
Definition: ORAField.php:50
ORAField\$is_pk
$is_pk
Definition: ORAField.php:7
ORAField\isKey
isKey()
Definition: ORAField.php:42
ORAField\$default
$default
Definition: ORAField.php:6
ORAField\$type
$type
Definition: ORAField.php:7
ORAField\$name
$name
Definition: ORAField.php:6
Wikimedia\Rdbms\Field
Base for all database-specific classes representing information about database fields.
Definition: Field.php:9
ORAField\$max_length
$max_length
Definition: ORAField.php:6
ORAField\isMultipleKey
isMultipleKey()
Definition: ORAField.php:46
ORAField\$is_key
$is_key
Definition: ORAField.php:7
ORAField\defaultValue
defaultValue()
Definition: ORAField.php:30
ORAField\$is_unique
$is_unique
Definition: ORAField.php:7
ORAField\tableName
tableName()
Name of table this field belongs to.
Definition: ORAField.php:26