3 namespace MediaWiki\Page
;
6 * Data record representing a page that is (or used to be, or could be)
7 * an editable page on a wiki.
9 * For compatibility with the WikiPage class, PageIdentity instances may
10 * represent non-existing pages. In the future, the contract of this interface is intended
11 * to be changed to disallow this. PageIdentity instances may also
12 * be mutable, and return different values from methods such as getLatest() or isRedirect()
13 * at different times. In the future, the contract of this interface is intended
14 * to be changed to disallow this.
16 * Only WikiPage should implement PageRecord directly, other implementations should use
17 * ExistingPageRecord instead. Once WikiPage is removed or guaranteed to be immutable and
18 * existing, ExistingPageRecord will become an alias of PageRecord.
20 * @see https://www.mediawiki.org/wiki/Manual:Modeling_pages
26 interface PageRecord
extends ProperPageIdentity
{
29 * False if the page has had more than one edit.
31 * @warning this is not guaranteed to always return true for old pages that have only one edit.
35 public function isNew();
38 * True if the page is a redirect.
42 public function isRedirect();
45 * The ID of the page's latest revision.
47 * @param string|false $wikiId Must be provided when accessing the ID of the latest revision of
48 * a non-local PageRecord, to prevent data corruption when using a PageRecord belonging
49 * to one wiki in the context of another. Should be omitted if expecting the local wiki.
51 * @return int The revision ID of the page's latest revision, or 0 if the page does not exist.
53 public function getLatest( $wikiId = self
::LOCAL
);
56 * Timestamp at which the page was last flagged for rerendering.
60 public function getTouched();
63 * The page's language, if explicitly recorded.
64 * The effective page language needs to be determined programmatically.
68 public function getLanguage();