Index: trunk/extensions/Wikidata/OmegaWiki/Transaction.php |
— | — | @@ -6,17 +6,17 @@ |
7 | 7 | require_once('Wikidata.php'); |
8 | 8 | |
9 | 9 | interface QueryTransactionInformation { |
10 | | - public function getRestriction($table); |
| 10 | + public function getRestriction(Table $table); |
11 | 11 | public function getTables(); |
12 | 12 | public function versioningAttributes(); |
13 | 13 | public function versioningFields($tableName); |
14 | 14 | 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); |
17 | 17 | } |
18 | 18 | |
19 | 19 | class DefaultQueryTransactionInformation implements QueryTransactionInformation { |
20 | | - public function getRestriction($table) { |
| 20 | + public function getRestriction(Table $table) { |
21 | 21 | return "1"; |
22 | 22 | } |
23 | 23 | |
— | — | @@ -36,11 +36,11 @@ |
37 | 37 | return array(); |
38 | 38 | } |
39 | 39 | |
40 | | - public function versioningGroupBy($table) { |
| 40 | + public function versioningGroupBy(Table $table) { |
41 | 41 | return array(); |
42 | 42 | } |
43 | 43 | |
44 | | - public function setVersioningAttributes($record, $row) { |
| 44 | + public function setVersioningAttributes(Record $record, $row) { |
45 | 45 | } |
46 | 46 | |
47 | 47 | public function __toString() { |
— | — | @@ -49,11 +49,11 @@ |
50 | 50 | } |
51 | 51 | |
52 | 52 | class QueryLatestTransactionInformation extends DefaultQueryTransactionInformation { |
53 | | - public function getRestriction($table) { |
| 53 | + public function getRestriction(Table $table) { |
54 | 54 | return getLatestTransactionRestriction($table->identifier); |
55 | 55 | } |
56 | 56 | |
57 | | - public function setVersioningAttributes($record, $row) { |
| 57 | + public function setVersioningAttributes(Record $record, $row) { |
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
— | — | @@ -73,7 +73,7 @@ |
74 | 74 | return array('is_live DESC', 'add_transaction_id DESC'); |
75 | 75 | } |
76 | 76 | |
77 | | - public function setVersioningAttributes($record, $row) { |
| 77 | + public function setVersioningAttributes(Record $record, $row) { |
78 | 78 | global |
79 | 79 | $recordLifeSpanAttribute; |
80 | 80 | |
— | — | @@ -90,7 +90,7 @@ |
91 | 91 | $this->addAttributes = $addAttributes; |
92 | 92 | } |
93 | 93 | |
94 | | - public function getRestriction($table) { |
| 94 | + public function getRestriction(Table $table) { |
95 | 95 | return getAtTransactionRestriction($table->identifier, $this->transactionId); |
96 | 96 | } |
97 | 97 | |
— | — | @@ -108,7 +108,7 @@ |
109 | 109 | return array($tableName . '.add_transaction_id', $tableName . '.remove_transaction_id', $tableName . '.remove_transaction_id IS NULL AS is_live'); |
110 | 110 | } |
111 | 111 | |
112 | | - public function setVersioningAttributes($record, $row) { |
| 112 | + public function setVersioningAttributes(Record $record, $row) { |
113 | 113 | global |
114 | 114 | $recordLifeSpanAttribute; |
115 | 115 | |
— | — | @@ -124,7 +124,7 @@ |
125 | 125 | $this->transactionId = $transactionId; |
126 | 126 | } |
127 | 127 | |
128 | | - public function getRestriction($table) { |
| 128 | + public function getRestriction(Table $table) { |
129 | 129 | return |
130 | 130 | " " . $table->identifier . ".add_transaction_id =". $this->transactionId . |
131 | 131 | " OR " . $table->identifier . ".removeTransactionId =" . $this->transactionId; |
— | — | @@ -160,7 +160,7 @@ |
161 | 161 | $this->showCommunityContribution = $showCommunityContribution; |
162 | 162 | } |
163 | 163 | |
164 | | - protected function getKeyFieldRestrictions($table, $prefix) { |
| 164 | + protected function getKeyFieldRestrictions(Table $table, $prefix) { |
165 | 165 | $result = array(); |
166 | 166 | |
167 | 167 | foreach ($table->keyFields as $keyField) |
— | — | @@ -169,8 +169,7 @@ |
170 | 170 | return implode(" AND ", $result); |
171 | 171 | } |
172 | 172 | |
173 | | - public function getRestriction($table) { |
174 | | - |
| 173 | + public function getRestriction(Table $table) { |
175 | 174 | $dc=wdGetDataSetContext(); |
176 | 175 | $result = |
177 | 176 | $table->identifier . ".add_transaction_id={$dc}_transactions.transaction_id"; |
— | — | @@ -253,7 +252,7 @@ |
254 | 253 | return array("{$dc}_transactions.user_id", $tableName . '.add_transaction_id'); |
255 | 254 | } |
256 | 255 | |
257 | | - public function setVersioningAttributes($record, $row) { |
| 256 | + public function setVersioningAttributes(Record $record, $row) { |
258 | 257 | global |
259 | 258 | $authorityAttribute; |
260 | 259 | |