r23639 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23638‎ | r23639 | r23640 >
Date:11:59, 2 July 2007
Author:kim
Status:old
Tags:
Comment:
Tidy up some stuff in RecordHelper
created SaveDM to test saving.
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/RecordHelper.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SaveDM.php (added) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/RecordHelper.php
@@ -88,7 +88,6 @@
8989
9090 class DefinitionHelper extends Helper {
9191 public function __construct($record) {
92 - echo "DefinitionHelper\n";
9392 Helper::__construct($record);
9493 }
9594
@@ -97,34 +96,34 @@
9897
9998 class TranslatedTextHelper extends Helper {
10099 public function __construct($record) {
101 - echo "TranslatedTextHelper\n";
102100 Helper::__construct($record);
103101 }
104102 }
105103
106104 class ObjectAttributesHelper extends Helper {
107105 public function __construct($record) {
108 - echo "ObjectAttributesHelper\n";
109106 Helper::__construct($record);
110107 }
111108 }
112109
113110 class SynonymsTranslationsHelper extends Helper {
114111 public function __construct($record) {
115 - echo "SynonymsTranslationsHelper\n";
116112 Helper::__construct($record);
117113 }
118114 }
119115
120116 class ExpressionHelper extends Helper {
121117 public function __construct($record) {
122 - echo "ExpressionHelper\n";
123118 Helper::__construct($record);
124 - echo $record;
 119+ #echo $record;
125120 }
126121
 122+ // Actually going to use save for now (kind of hack)
127123 public function getSaveSQL($dc="uw") {
128124 $dc=wdGetDataSetContext($dc);
 125+ }
 126+
 127+ public function save() {
129128
130129 }
131130 }
@@ -132,56 +131,48 @@
133132
134133 class RelationsHelper extends Helper {
135134 public function __construct($record) {
136 - echo "RelationsHelper\n";
137135 Helper::__construct($record);
138136 }
139137 }
140138
141139 class RelationTypeHelper extends Helper {
142140 public function __construct($record) {
143 - echo "RelationTypeHelper\n";
144141 Helper::__construct($record);
145142 }
146143 }
147144
148145 class OtherDefinedMeaningHelper extends Helper {
149146 public function __construct($record) {
150 - echo "OtherDefinedMeaningHelper\n";
151147 Helper::__construct($record);
152148 }
153149 }
154150
155151 class ReciprocalRelationsHelper extends Helper {
156152 public function __construct($record) {
157 - echo "ReciprocalRelationsHelper\n";
158153 Helper::__construct($record);
159154 }
160155 }
161156
162157 class CollectionMembershipHelper extends Helper {
163158 public function __construct($record) {
164 - echo "CollectionMembershipHelper\n";
165159 Helper::__construct($record);
166160 }
167161 }
168162
169163 class CollectionMeaningHelper extends Helper {
170164 public function __construct($record) {
171 - echo "CollectionMeaningHelper\n";
172165 Helper::__construct($record);
173166 }
174167 }
175168
176169 class GotoSourceHelper extends Helper {
177170 public function __construct($record) {
178 - echo "GotoSourceHelper\n";
179171 Helper::__construct($record);
180172 }
181173 }
182174
183175 class DefinedMeaningAttributesHelper extends Helper {
184176 public function __construct($record) {
185 - echo "DefinedMeaningAttributesHelper\n";
186177 Helper::__construct($record);
187178 }
188179 }
Index: trunk/extensions/Wikidata/OmegaWiki/SaveDM.php
@@ -0,0 +1,49 @@
 2+<?php
 3+
 4+# let's see...
 5+
 6+define('MEDIAWIKI', true );
 7+
 8+# do we seriously need ALL of these?
 9+require_once("../../../StartProfiler.php");
 10+require_once("../../../LocalSettings.php");
 11+require_once("../php-tools/ProgressBar.php");
 12+#require_once("DatabaseUtilities.php");
 13+require_once("Setup.php");
 14+require_once("DefinedMeaningModel.php");
 15+require_once("Transaction.php");
 16+
 17+/** Just get a defined meaning */
 18+function getDM($dm_id,$dc="uw") {
 19+ $definedMeaningId=663665; # UnitTest
 20+ $filterLanguageId=0; # ??? What does this do ???
 21+ $possiblySynonymousRelationTypeId=0; # ??? What does this do ???
 22+ $queryTransactionInformation= new QueryLatestTransactionInformation();
 23+ $model=new DefinedMeaningModel($definedMeaningId, $filterLanguageId, $possiblySynonymousRelationTypeId, $queryTransactionInformation);
 24+ $record=$model->getRecord();
 25+ $record->finish("DefinedMeaning");
 26+ return $model;
 27+}
 28+
 29+function saveDM($model) {
 30+ $model->saveWithinTransaction();
 31+}
 32+
 33+global
 34+$beginTime, $wgCommandLineMode, $dc;
 35+
 36+$beginTime = time();
 37+$wgCommandLineMode = true;
 38+# $dc = "uw"; < can't modify from here
 39+
 40+/* insert code here */
 41+
 42+$model=getDM(663655);
 43+$record=$model->getRecord();
 44+echo $record;
 45+
 46+
 47+$endTime = time();
 48+echo("\n\nTime elapsed: " . durationToString($endTime - $beginTime));
 49+
 50+

Status & tagging log