Index: trunk/phase3/includes/Article.php |
— | — | @@ -127,6 +127,19 @@ |
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
| 131 | + * Create an Article object of the appropriate class for the given page. |
| 132 | + * |
| 133 | + * @param $page WikiPage |
| 134 | + * @param $context IContextSource |
| 135 | + * @return Article object |
| 136 | + */ |
| 137 | + public static function newFromWikiPage( WikiPage $page, IContextSource $context ) { |
| 138 | + $article = self::newFromTitle( $page->getTitle(), $context ); |
| 139 | + $article->mPage = $page; // override to keep process cached vars |
| 140 | + return $article; |
| 141 | + } |
| 142 | + |
| 143 | + /** |
131 | 144 | * Tell the page view functions that this view was redirected |
132 | 145 | * from another page on the wiki. |
133 | 146 | * @param $from Title object. |