r23019 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23018‎ | r23019 | r23020 >
Date:22:46, 15 June 2007
Author:kim
Status:old
Tags:
Comment:
Transferring to thex... poor empire has a b0rked db...
(this revision may be broken)
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/Record.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/RecordHelper.php (added) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/Record.php
@@ -1,6 +1,7 @@
22 <?php
33
44 require_once('Attribute.php');
 5+require_once('RecordHelper.php');
56
67 interface Record {
78 public function getStructure();
@@ -12,9 +13,11 @@
1314 protected $structure;
1415 protected $values = array();
1516 protected $type = null;
 17+ protected $helper=null;
1618
1719 public function __construct($structure) {
1820 $this->structure = $structure;
 21+ $this->helper=new RecordHelper($this);
1922 }
2023
2124 public function getStructure() {
Index: trunk/extensions/Wikidata/OmegaWiki/RecordHelper.php
@@ -0,0 +1,23 @@
 2+<?php
 3+
 4+class RecordHelperFactory {
 5+ function __construct() {
 6+ # ---
 7+ }
 8+
 9+ function getRecordHelper($record) {
 10+ $type=$record->type();
 11+ if (empty($type))
 12+ return null;
 13+ switch($type) {
 14+ case "expression":
 15+ echo "express!";
 16+ break;
 17+ case "synonyms-translations":
 18+ echo "sinner!";
 19+ break;
 20+ }
 21+
 22+ }
 23+}
 24+?>

Status & tagging log