https://www.mediawiki.org/wiki/Special:Code/MediaWiki/103214
Revision: 103214 Author: aaron Date: 2011-11-15 19:41:32 +0000 (Tue, 15 Nov 2011) Log Message: ----------- Added Article::newFromWikiPage() function to create an appropriate Article object from a WikiPage and keep the process cache vars of the later Modified Paths: -------------- trunk/phase3/includes/Article.php Modified: trunk/phase3/includes/Article.php =================================================================== --- trunk/phase3/includes/Article.php 2011-11-15 19:30:25 UTC (rev 103213) +++ trunk/phase3/includes/Article.php 2011-11-15 19:41:32 UTC (rev 103214) @@ -127,6 +127,19 @@ } /** + * Create an Article object of the appropriate class for the given page. + * + * @param $page WikiPage + * @param $context IContextSource + * @return Article object + */ + public static function newFromWikiPage( WikiPage $page, IContextSource $context ) { + $article = self::newFromTitle( $page->getTitle(), $context ); + $article->mPage = $page; // override to keep process cached vars + return $article; + } + + /** * Tell the page view functions that this view was redirected * from another page on the wiki. * @param $from Title object. _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs