r24881 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24880‎ | r24881 | r24882 >
Date:16:44, 17 August 2007
Author:kim
Status:old
Tags:
Comment:
Tweaks to Record.php and DefinedMeaningModel.php
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/Record.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/Record.php
@@ -6,7 +6,7 @@
77
88 interface Record {
99 public function getStructure();
10 - public function getAttributeValue(Attribute $attribute);
 10+ public function getAttributeValue($attribute);
1111 public function project(Structure $structure);
1212 }
1313
@@ -25,7 +25,7 @@
2626 return $this->structure;
2727 }
2828
29 - public function getAttributeValue(Attribute $attribute) {
 29+ public function getAttributeValue($attribute) {
3030 #FIXME: check if valid
3131 return @$this->values[$attribute->id];
3232 }
@@ -52,7 +52,8 @@
5353 * In future, this should check against an attributes global with string
5454 * lookup, and might even be smart.
5555 * For now, this just does a direct lookup.
56 - * @deprecated use __get and __set instead
 56+ *
 57+ * @deprecated use __get and __set instead now
5758 */
5859 public function getValue($key) {
5960 return @$this->values[$key];
Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php
@@ -179,11 +179,12 @@
180180 initializeObjectAttributeEditors($this->viewInformation);
181181
182182 # Nice try sherlock, but we really need to get our DMID from elsewhere
183 - #$definedMeaningId = $this->getId();
 183+ #$definedMeaningId = $this->getId();
184184
185185 #Need 3 steps: copy defining expression, create new dm, then update
186186
187187 $expression=$this->dupDefiningExpression();
 188+ var_dump($expression);
188189 # to make the expression really work, we may need to call
189190 # more here?
190191 $expression->createNewInDatabase();
@@ -191,10 +192,12 @@
192193 # shouldn't this stuff be protected?
193194 $expressionId=$expression->id;
194195 $languageId=$expression->languageId;
195 - $text="Copied Defined Meaning"; // this might work for now
196 - // but where to get useful
197 - // text?
 196+ #$text="Copied Defined Meaning"; // this might work for now
 197+ # // but where to get useful
 198+ # // text?
198199
 200+ $text=$this->getTitleText();
 201+
199202 #here we assume the DM is not there yet.. not entirely wise
200203 #in the long run.
201204 echo "id: $expressionId lang: $languageId";
@@ -212,7 +215,7 @@
213216 protected function getIdStack($definedMeaningId) {
214217 $o=OmegaWikiAttributes::getInstance();
215218
216 - $definedMeaningIdStructure = new Structure($o->$definedMeaningId);
 219+ $definedMeaningIdStructure = new Structure($o->definedMeaningId);
217220 $definedMeaningIdRecord = new ArrayRecord($definedMeaningIdStructure, $definedMeaningIdStructure);
218221 $definedMeaningIdRecord->definedMeaningId= $definedMeaningId;
219222
@@ -275,9 +278,10 @@
276279 protected function dupDefiningExpression() {
277280
278281 $record=$this->getRecord();
279 - $expression=$record->getValue("defined-meaning-full-defining-expression");
280 - $spelling=$expression->getValue("defined-meaning-defining-expression");
281 - $language=$expression->getValue("language");
 282+ $expression=$record->expression;
 283+ echo var_dump($expression);
 284+ $spelling=$expression->definedMeaningDefiningExpression;
 285+ $language=$expression->language;
282286 return findOrCreateExpression($spelling, $language);
283287 }
284288

Status & tagging log