r23037 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23036‎ | r23037 | r23038 >
Date:19:35, 16 June 2007
Author:kim
Status:old
Tags:
Comment:
Now linking classes
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/RecordHelper.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/RecordHelper.php
@@ -9,38 +9,38 @@
1010 echo "HELPING $type .... ";
1111 switch($type) {
1212 case "definition":
13 - return new DefinitionHelper();
 13+ return new DefinitionHelper($record);
1414 case "translated-text":
15 - return new TranslatedTextHelper();
 15+ return new TranslatedTextHelper($record);
1616 case "object-attributes":
17 - return new ObjectAttributesHelper();
 17+ return new ObjectAttributesHelper($record);
1818 case "synonyms-translations":
19 - return new SynonymsTranslationsHelper();
 19+ return new SynonymsTranslationsHelper($record);
2020 break;
2121 case "expression":
22 - return new ExpressionHelper();
 22+ return new ExpressionHelper($record);
2323 break;
2424 case "relations":
25 - return new RelationsHelper();
 25+ return new RelationsHelper($record);
2626 break;
2727 case "relation-type":
28 - return new RelationTypeHelper();
 28+ return new RelationTypeHelper($record);
2929 break;
3030 case "other-defined-meaning":
31 - return new OtherDefinedMeaningHelper();
 31+ return new OtherDefinedMeaningHelper($record);
3232 break;
3333 case "reciprocal-relations":
34 - return new ReciprocalRelationsHelper();
 34+ return new ReciprocalRelationsHelper($record);
3535 break;
3636 case "collection-membership":
37 - return new CollectionMembershipHelper();
 37+ return new CollectionMembershipHelper($record);
3838 break;
3939 case "collection-meaning":
40 - return new CollectionMeaningHelper();
 40+ return new CollectionMeaningHelper($record);
4141 case "goto-source":
42 - return new GotoSourceHelper();
 42+ return new GotoSourceHelper($record);
4343 case "defined-meaning-attributes":
44 - return new DefinedMeaningAttributesHelper();
 44+ return new DefinedMeaningAttributesHelper($record);
4545 default :
4646 echo "IGIVEUP ($type) I Give Up! \n";
4747 break;
@@ -50,7 +50,9 @@
5151 }
5252
5353 abstract class Helper {
54 - public function __construct() {
 54+ protected $record;
 55+ public function __construct($record) {
 56+ $this->record=$record;
5557 }
5658
5759 public abstract function save();
@@ -58,9 +60,9 @@
5961 }
6062
6163 class DefinitionHelper extends Helper {
62 - public function __construct() {
 64+ public function __construct($record) {
6365 echo "DefinitionHelper\n";
64 - Helper::__construct();
 66+ Helper::__construct($record);
6567 }
6668
6769 public function save() {
@@ -71,9 +73,9 @@
7274 }
7375
7476 class TranslatedTextHelper extends Helper {
75 - public function __construct() {
 77+ public function __construct($record) {
7678 echo "TranslatedTextHelper\n";
77 - Helper::__construct();
 79+ Helper::__construct($record);
7880 }
7981
8082 public function save() {
@@ -84,9 +86,9 @@
8587 }
8688
8789 class ObjectAttributesHelper extends Helper {
88 - public function __construct() {
 90+ public function __construct($record) {
8991 echo "ObjectAttributesHelper\n";
90 - Helper::__construct();
 92+ Helper::__construct($record);
9193 }
9294
9395 public function save() {
@@ -97,9 +99,9 @@
98100 }
99101
100102 class SynonymsTranslationsHelper extends Helper {
101 - public function __construct() {
 103+ public function __construct($record) {
102104 echo "SynonymsTranslationsHelper\n";
103 - Helper::__construct();
 105+ Helper::__construct($record);
104106 }
105107
106108 public function save() {
@@ -110,9 +112,10 @@
111113 }
112114
113115 class ExpressionHelper extends Helper {
114 - public function __construct() {
 116+ public function __construct($record) {
115117 echo "ExpressionHelper\n";
116 - Helper::__construct();
 118+ Helper::__construct($record);
 119+ echo $record;
117120 }
118121
119122 public function save() {
@@ -124,9 +127,9 @@
125128
126129
127130 class RelationsHelper extends Helper {
128 - public function __construct() {
 131+ public function __construct($record) {
129132 echo "RelationsHelper\n";
130 - Helper::__construct();
 133+ Helper::__construct($record);
131134 }
132135
133136 public function save() {
@@ -137,9 +140,9 @@
138141 }
139142
140143 class RelationTypeHelper extends Helper {
141 - public function __construct() {
 144+ public function __construct($record) {
142145 echo "RelationTypeHelper\n";
143 - Helper::__construct();
 146+ Helper::__construct($record);
144147 }
145148
146149 public function save() {
@@ -148,9 +151,9 @@
149152 }
150153
151154 class OtherDefinedMeaningHelper extends Helper {
152 - public function __construct() {
 155+ public function __construct($record) {
153156 echo "OtherDefinedMeaningHelper\n";
154 - Helper::__construct();
 157+ Helper::__construct($record);
155158 }
156159
157160 public function save() {
@@ -161,9 +164,9 @@
162165 }
163166
164167 class ReciprocalRelationsHelper extends Helper {
165 - public function __construct() {
 168+ public function __construct($record) {
166169 echo "ReciprocalRelationsHelper\n";
167 - Helper::__construct();
 170+ Helper::__construct($record);
168171 }
169172
170173 public function save() {
@@ -174,9 +177,9 @@
175178 }
176179
177180 class CollectionMembershipHelper extends Helper {
178 - public function __construct() {
 181+ public function __construct($record) {
179182 echo "CollectionMembershipHelper\n";
180 - Helper::__construct();
 183+ Helper::__construct($record);
181184 }
182185
183186 public function save() {
@@ -187,9 +190,9 @@
188191 }
189192
190193 class CollectionMeaningHelper extends Helper {
191 - public function __construct() {
 194+ public function __construct($record) {
192195 echo "CollectionMeaningHelper\n";
193 - Helper::__construct();
 196+ Helper::__construct($record);
194197 }
195198
196199 public function save() {
@@ -200,9 +203,9 @@
201204 }
202205
203206 class GotoSourceHelper extends Helper {
204 - public function __construct() {
 207+ public function __construct($record) {
205208 echo "GotoSourceHelper\n";
206 - Helper::__construct();
 209+ Helper::__construct($record);
207210 }
208211
209212 public function save() {
@@ -213,9 +216,9 @@
214217 }
215218
216219 class DefinedMeaningAttributesHelper extends Helper {
217 - public function __construct() {
 220+ public function __construct($record) {
218221 echo "DefinedMeaningAttributesHelper\n";
219 - Helper::__construct();
 222+ Helper::__construct($record);
220223 }
221224
222225 public function save() {

Status & tagging log