Index: trunk/extensions/Wikidata/OmegaWiki/Record.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | |
8 | 8 | interface Record { |
9 | 9 | public function getStructure(); |
10 | | - public function getAttributeValue(Attribute $attribute); |
| 10 | + public function getAttributeValue($attribute); |
11 | 11 | public function project(Structure $structure); |
12 | 12 | } |
13 | 13 | |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | return $this->structure; |
27 | 27 | } |
28 | 28 | |
29 | | - public function getAttributeValue(Attribute $attribute) { |
| 29 | + public function getAttributeValue($attribute) { |
30 | 30 | #FIXME: check if valid |
31 | 31 | return @$this->values[$attribute->id]; |
32 | 32 | } |
— | — | @@ -52,7 +52,8 @@ |
53 | 53 | * In future, this should check against an attributes global with string |
54 | 54 | * lookup, and might even be smart. |
55 | 55 | * For now, this just does a direct lookup. |
56 | | - * @deprecated use __get and __set instead |
| 56 | + * |
| 57 | + * @deprecated use __get and __set instead now |
57 | 58 | */ |
58 | 59 | public function getValue($key) { |
59 | 60 | return @$this->values[$key]; |
Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php |
— | — | @@ -179,11 +179,12 @@ |
180 | 180 | initializeObjectAttributeEditors($this->viewInformation); |
181 | 181 | |
182 | 182 | # Nice try sherlock, but we really need to get our DMID from elsewhere |
183 | | - #$definedMeaningId = $this->getId(); |
| 183 | + #$definedMeaningId = $this->getId(); |
184 | 184 | |
185 | 185 | #Need 3 steps: copy defining expression, create new dm, then update |
186 | 186 | |
187 | 187 | $expression=$this->dupDefiningExpression(); |
| 188 | + var_dump($expression); |
188 | 189 | # to make the expression really work, we may need to call |
189 | 190 | # more here? |
190 | 191 | $expression->createNewInDatabase(); |
— | — | @@ -191,10 +192,12 @@ |
192 | 193 | # shouldn't this stuff be protected? |
193 | 194 | $expressionId=$expression->id; |
194 | 195 | $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? |
198 | 199 | |
| 200 | + $text=$this->getTitleText(); |
| 201 | + |
199 | 202 | #here we assume the DM is not there yet.. not entirely wise |
200 | 203 | #in the long run. |
201 | 204 | echo "id: $expressionId lang: $languageId"; |
— | — | @@ -212,7 +215,7 @@ |
213 | 216 | protected function getIdStack($definedMeaningId) { |
214 | 217 | $o=OmegaWikiAttributes::getInstance(); |
215 | 218 | |
216 | | - $definedMeaningIdStructure = new Structure($o->$definedMeaningId); |
| 219 | + $definedMeaningIdStructure = new Structure($o->definedMeaningId); |
217 | 220 | $definedMeaningIdRecord = new ArrayRecord($definedMeaningIdStructure, $definedMeaningIdStructure); |
218 | 221 | $definedMeaningIdRecord->definedMeaningId= $definedMeaningId; |
219 | 222 | |
— | — | @@ -275,9 +278,10 @@ |
276 | 279 | protected function dupDefiningExpression() { |
277 | 280 | |
278 | 281 | $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; |
282 | 286 | return findOrCreateExpression($spelling, $language); |
283 | 287 | } |
284 | 288 | |