r23674 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23673‎ | r23674 | r23675 >
Date:16:36, 3 July 2007
Author:proes
Status:old
Tags:
Comment:
Added type hints for Transaction.php
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/Transaction.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/Transaction.php
@@ -6,17 +6,17 @@
77 require_once('Wikidata.php');
88
99 interface QueryTransactionInformation {
10 - public function getRestriction($table);
 10+ public function getRestriction(Table $table);
1111 public function getTables();
1212 public function versioningAttributes();
1313 public function versioningFields($tableName);
1414 public function versioningOrderBy();
15 - public function versioningGroupBy($table);
16 - public function setVersioningAttributes($record, $row);
 15+ public function versioningGroupBy(Table $table);
 16+ public function setVersioningAttributes(Record $record, $row);
1717 }
1818
1919 class DefaultQueryTransactionInformation implements QueryTransactionInformation {
20 - public function getRestriction($table) {
 20+ public function getRestriction(Table $table) {
2121 return "1";
2222 }
2323
@@ -36,11 +36,11 @@
3737 return array();
3838 }
3939
40 - public function versioningGroupBy($table) {
 40+ public function versioningGroupBy(Table $table) {
4141 return array();
4242 }
4343
44 - public function setVersioningAttributes($record, $row) {
 44+ public function setVersioningAttributes(Record $record, $row) {
4545 }
4646
4747 public function __toString() {
@@ -49,11 +49,11 @@
5050 }
5151
5252 class QueryLatestTransactionInformation extends DefaultQueryTransactionInformation {
53 - public function getRestriction($table) {
 53+ public function getRestriction(Table $table) {
5454 return getLatestTransactionRestriction($table->identifier);
5555 }
5656
57 - public function setVersioningAttributes($record, $row) {
 57+ public function setVersioningAttributes(Record $record, $row) {
5858 }
5959 }
6060
@@ -73,7 +73,7 @@
7474 return array('is_live DESC', 'add_transaction_id DESC');
7575 }
7676
77 - public function setVersioningAttributes($record, $row) {
 77+ public function setVersioningAttributes(Record $record, $row) {
7878 global
7979 $recordLifeSpanAttribute;
8080
@@ -90,7 +90,7 @@
9191 $this->addAttributes = $addAttributes;
9292 }
9393
94 - public function getRestriction($table) {
 94+ public function getRestriction(Table $table) {
9595 return getAtTransactionRestriction($table->identifier, $this->transactionId);
9696 }
9797
@@ -108,7 +108,7 @@
109109 return array($tableName . '.add_transaction_id', $tableName . '.remove_transaction_id', $tableName . '.remove_transaction_id IS NULL AS is_live');
110110 }
111111
112 - public function setVersioningAttributes($record, $row) {
 112+ public function setVersioningAttributes(Record $record, $row) {
113113 global
114114 $recordLifeSpanAttribute;
115115
@@ -124,7 +124,7 @@
125125 $this->transactionId = $transactionId;
126126 }
127127
128 - public function getRestriction($table) {
 128+ public function getRestriction(Table $table) {
129129 return
130130 " " . $table->identifier . ".add_transaction_id =". $this->transactionId .
131131 " OR " . $table->identifier . ".removeTransactionId =" . $this->transactionId;
@@ -160,7 +160,7 @@
161161 $this->showCommunityContribution = $showCommunityContribution;
162162 }
163163
164 - protected function getKeyFieldRestrictions($table, $prefix) {
 164+ protected function getKeyFieldRestrictions(Table $table, $prefix) {
165165 $result = array();
166166
167167 foreach ($table->keyFields as $keyField)
@@ -169,8 +169,7 @@
170170 return implode(" AND ", $result);
171171 }
172172
173 - public function getRestriction($table) {
174 -
 173+ public function getRestriction(Table $table) {
175174 $dc=wdGetDataSetContext();
176175 $result =
177176 $table->identifier . ".add_transaction_id={$dc}_transactions.transaction_id";
@@ -253,7 +252,7 @@
254253 return array("{$dc}_transactions.user_id", $tableName . '.add_transaction_id');
255254 }
256255
257 - public function setVersioningAttributes($record, $row) {
 256+ public function setVersioningAttributes(Record $record, $row) {
258257 global
259258 $authorityAttribute;
260259

Status & tagging log