Index: trunk/extensions/Wikidata/OmegaWiki/RecordHelper.php |
— | — | @@ -9,38 +9,38 @@ |
10 | 10 | echo "HELPING $type .... "; |
11 | 11 | switch($type) { |
12 | 12 | case "definition": |
13 | | - return new DefinitionHelper(); |
| 13 | + return new DefinitionHelper($record); |
14 | 14 | case "translated-text": |
15 | | - return new TranslatedTextHelper(); |
| 15 | + return new TranslatedTextHelper($record); |
16 | 16 | case "object-attributes": |
17 | | - return new ObjectAttributesHelper(); |
| 17 | + return new ObjectAttributesHelper($record); |
18 | 18 | case "synonyms-translations": |
19 | | - return new SynonymsTranslationsHelper(); |
| 19 | + return new SynonymsTranslationsHelper($record); |
20 | 20 | break; |
21 | 21 | case "expression": |
22 | | - return new ExpressionHelper(); |
| 22 | + return new ExpressionHelper($record); |
23 | 23 | break; |
24 | 24 | case "relations": |
25 | | - return new RelationsHelper(); |
| 25 | + return new RelationsHelper($record); |
26 | 26 | break; |
27 | 27 | case "relation-type": |
28 | | - return new RelationTypeHelper(); |
| 28 | + return new RelationTypeHelper($record); |
29 | 29 | break; |
30 | 30 | case "other-defined-meaning": |
31 | | - return new OtherDefinedMeaningHelper(); |
| 31 | + return new OtherDefinedMeaningHelper($record); |
32 | 32 | break; |
33 | 33 | case "reciprocal-relations": |
34 | | - return new ReciprocalRelationsHelper(); |
| 34 | + return new ReciprocalRelationsHelper($record); |
35 | 35 | break; |
36 | 36 | case "collection-membership": |
37 | | - return new CollectionMembershipHelper(); |
| 37 | + return new CollectionMembershipHelper($record); |
38 | 38 | break; |
39 | 39 | case "collection-meaning": |
40 | | - return new CollectionMeaningHelper(); |
| 40 | + return new CollectionMeaningHelper($record); |
41 | 41 | case "goto-source": |
42 | | - return new GotoSourceHelper(); |
| 42 | + return new GotoSourceHelper($record); |
43 | 43 | case "defined-meaning-attributes": |
44 | | - return new DefinedMeaningAttributesHelper(); |
| 44 | + return new DefinedMeaningAttributesHelper($record); |
45 | 45 | default : |
46 | 46 | echo "IGIVEUP ($type) I Give Up! \n"; |
47 | 47 | break; |
— | — | @@ -50,7 +50,9 @@ |
51 | 51 | } |
52 | 52 | |
53 | 53 | abstract class Helper { |
54 | | - public function __construct() { |
| 54 | + protected $record; |
| 55 | + public function __construct($record) { |
| 56 | + $this->record=$record; |
55 | 57 | } |
56 | 58 | |
57 | 59 | public abstract function save(); |
— | — | @@ -58,9 +60,9 @@ |
59 | 61 | } |
60 | 62 | |
61 | 63 | class DefinitionHelper extends Helper { |
62 | | - public function __construct() { |
| 64 | + public function __construct($record) { |
63 | 65 | echo "DefinitionHelper\n"; |
64 | | - Helper::__construct(); |
| 66 | + Helper::__construct($record); |
65 | 67 | } |
66 | 68 | |
67 | 69 | public function save() { |
— | — | @@ -71,9 +73,9 @@ |
72 | 74 | } |
73 | 75 | |
74 | 76 | class TranslatedTextHelper extends Helper { |
75 | | - public function __construct() { |
| 77 | + public function __construct($record) { |
76 | 78 | echo "TranslatedTextHelper\n"; |
77 | | - Helper::__construct(); |
| 79 | + Helper::__construct($record); |
78 | 80 | } |
79 | 81 | |
80 | 82 | public function save() { |
— | — | @@ -84,9 +86,9 @@ |
85 | 87 | } |
86 | 88 | |
87 | 89 | class ObjectAttributesHelper extends Helper { |
88 | | - public function __construct() { |
| 90 | + public function __construct($record) { |
89 | 91 | echo "ObjectAttributesHelper\n"; |
90 | | - Helper::__construct(); |
| 92 | + Helper::__construct($record); |
91 | 93 | } |
92 | 94 | |
93 | 95 | public function save() { |
— | — | @@ -97,9 +99,9 @@ |
98 | 100 | } |
99 | 101 | |
100 | 102 | class SynonymsTranslationsHelper extends Helper { |
101 | | - public function __construct() { |
| 103 | + public function __construct($record) { |
102 | 104 | echo "SynonymsTranslationsHelper\n"; |
103 | | - Helper::__construct(); |
| 105 | + Helper::__construct($record); |
104 | 106 | } |
105 | 107 | |
106 | 108 | public function save() { |
— | — | @@ -110,9 +112,10 @@ |
111 | 113 | } |
112 | 114 | |
113 | 115 | class ExpressionHelper extends Helper { |
114 | | - public function __construct() { |
| 116 | + public function __construct($record) { |
115 | 117 | echo "ExpressionHelper\n"; |
116 | | - Helper::__construct(); |
| 118 | + Helper::__construct($record); |
| 119 | + echo $record; |
117 | 120 | } |
118 | 121 | |
119 | 122 | public function save() { |
— | — | @@ -124,9 +127,9 @@ |
125 | 128 | |
126 | 129 | |
127 | 130 | class RelationsHelper extends Helper { |
128 | | - public function __construct() { |
| 131 | + public function __construct($record) { |
129 | 132 | echo "RelationsHelper\n"; |
130 | | - Helper::__construct(); |
| 133 | + Helper::__construct($record); |
131 | 134 | } |
132 | 135 | |
133 | 136 | public function save() { |
— | — | @@ -137,9 +140,9 @@ |
138 | 141 | } |
139 | 142 | |
140 | 143 | class RelationTypeHelper extends Helper { |
141 | | - public function __construct() { |
| 144 | + public function __construct($record) { |
142 | 145 | echo "RelationTypeHelper\n"; |
143 | | - Helper::__construct(); |
| 146 | + Helper::__construct($record); |
144 | 147 | } |
145 | 148 | |
146 | 149 | public function save() { |
— | — | @@ -148,9 +151,9 @@ |
149 | 152 | } |
150 | 153 | |
151 | 154 | class OtherDefinedMeaningHelper extends Helper { |
152 | | - public function __construct() { |
| 155 | + public function __construct($record) { |
153 | 156 | echo "OtherDefinedMeaningHelper\n"; |
154 | | - Helper::__construct(); |
| 157 | + Helper::__construct($record); |
155 | 158 | } |
156 | 159 | |
157 | 160 | public function save() { |
— | — | @@ -161,9 +164,9 @@ |
162 | 165 | } |
163 | 166 | |
164 | 167 | class ReciprocalRelationsHelper extends Helper { |
165 | | - public function __construct() { |
| 168 | + public function __construct($record) { |
166 | 169 | echo "ReciprocalRelationsHelper\n"; |
167 | | - Helper::__construct(); |
| 170 | + Helper::__construct($record); |
168 | 171 | } |
169 | 172 | |
170 | 173 | public function save() { |
— | — | @@ -174,9 +177,9 @@ |
175 | 178 | } |
176 | 179 | |
177 | 180 | class CollectionMembershipHelper extends Helper { |
178 | | - public function __construct() { |
| 181 | + public function __construct($record) { |
179 | 182 | echo "CollectionMembershipHelper\n"; |
180 | | - Helper::__construct(); |
| 183 | + Helper::__construct($record); |
181 | 184 | } |
182 | 185 | |
183 | 186 | public function save() { |
— | — | @@ -187,9 +190,9 @@ |
188 | 191 | } |
189 | 192 | |
190 | 193 | class CollectionMeaningHelper extends Helper { |
191 | | - public function __construct() { |
| 194 | + public function __construct($record) { |
192 | 195 | echo "CollectionMeaningHelper\n"; |
193 | | - Helper::__construct(); |
| 196 | + Helper::__construct($record); |
194 | 197 | } |
195 | 198 | |
196 | 199 | public function save() { |
— | — | @@ -200,9 +203,9 @@ |
201 | 204 | } |
202 | 205 | |
203 | 206 | class GotoSourceHelper extends Helper { |
204 | | - public function __construct() { |
| 207 | + public function __construct($record) { |
205 | 208 | echo "GotoSourceHelper\n"; |
206 | | - Helper::__construct(); |
| 209 | + Helper::__construct($record); |
207 | 210 | } |
208 | 211 | |
209 | 212 | public function save() { |
— | — | @@ -213,9 +216,9 @@ |
214 | 217 | } |
215 | 218 | |
216 | 219 | class DefinedMeaningAttributesHelper extends Helper { |
217 | | - public function __construct() { |
| 220 | + public function __construct($record) { |
218 | 221 | echo "DefinedMeaningAttributesHelper\n"; |
219 | | - Helper::__construct(); |
| 222 | + Helper::__construct($record); |
220 | 223 | } |
221 | 224 | |
222 | 225 | public function save() { |