File: PageRecord.php

package info (click to toggle)
mediawiki 1%3A1.43.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 417,464 kB
  • sloc: php: 1,062,949; javascript: 664,290; sql: 9,714; python: 5,458; xml: 3,489; sh: 1,131; makefile: 64
file content (69 lines) | stat: -rw-r--r-- 2,134 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php

namespace MediaWiki\Page;

/**
 * Data record representing a page that is (or used to be, or could be)
 * an editable page on a wiki.
 *
 * For compatibility with the WikiPage class, PageIdentity instances may
 * represent non-existing pages. In the future, the contract of this interface is intended
 * to be changed to disallow this. PageIdentity instances may also
 * be mutable, and return different values from methods such as getLatest() or isRedirect()
 * at different times. In the future, the contract of this interface is intended
 * to be changed to disallow this.
 *
 * Only WikiPage should implement PageRecord directly, other implementations should use
 * ExistingPageRecord instead. Once WikiPage is removed or guaranteed to be immutable and
 * existing, ExistingPageRecord will become an alias of PageRecord.
 *
 * @see https://www.mediawiki.org/wiki/Manual:Modeling_pages
 *
 * @stable to type
 * @since 1.36
 * @ingroup Page
 */
interface PageRecord extends ProperPageIdentity {

	/**
	 * False if the page has had more than one edit.
	 *
	 * @warning this is not guaranteed to always return true for old pages that have only one edit.
	 *
	 * @return bool
	 */
	public function isNew();

	/**
	 * True if the page is a redirect.
	 *
	 * @return bool
	 */
	public function isRedirect();

	/**
	 * The ID of the page's latest revision.
	 *
	 * @param string|false $wikiId Must be provided when accessing the ID of the latest revision of
	 *        a non-local PageRecord, to prevent data corruption when using a PageRecord belonging
	 *        to one wiki in the context of another. Should be omitted if expecting the local wiki.
	 *
	 * @return int The revision ID of the page's latest revision, or 0 if the page does not exist.
	 */
	public function getLatest( $wikiId = self::LOCAL );

	/**
	 * Timestamp at which the page was last flagged for rerendering.
	 *
	 * @return string
	 */
	public function getTouched();

	/**
	 * The page's language, if explicitly recorded.
	 * The effective page language needs to be determined programmatically.
	 *
	 * @return ?string
	 */
	public function getLanguage();
}