r86489 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86488‎ | r86489 | r86490 >
Date:16:24, 20 April 2011
Author:mkroetzsch
Status:deferred
Tags:
Comment:
convenience method for making a DIWikiPage from a Title
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_WikiPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_WikiPage.php
@@ -89,4 +89,15 @@
9090 return new SMWDIWikiPage( $parts[0], floatval( $parts[1] ), $parts[2], $typeid );
9191 }
9292
 93+ /**
 94+ * Create a data item from a MediaWiki Title.
 95+ *
 96+ * @param $title Title
 97+ * @param $typeid string optional type ID to use
 98+ * @return SMWDIWikiPage
 99+ */
 100+ public static function newFromTitle( Title $title, $typeid = '_wpg' ) {
 101+ return new SMWDIWikiPage( $title->getDBkey(), $title->getNamespace(), $title->getInterwiki(), $typeid );
 102+ }
 103+
93104 }

Status & tagging log