Index: trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_WikiPage.php |
— | — | @@ -89,4 +89,15 @@ |
90 | 90 | return new SMWDIWikiPage( $parts[0], floatval( $parts[1] ), $parts[2], $typeid ); |
91 | 91 | } |
92 | 92 | |
| 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 | + |
93 | 104 | } |