MediaWiki  master
Page\PageStoreRecord Class Reference

Immutable data record representing an editable page on a wiki. More...

Inheritance diagram for Page\PageStoreRecord:
Collaboration diagram for Page\PageStoreRecord:

Public Member Functions

 __construct (stdClass $row, $wikiId)
 The $row object must provide all fields listed in PageStoreRecord::REQUIRED_FIELDS. More...
 
 getLanguage ()
 Language in which the page is written. More...
 
 getLatest ( $wikiId=self::LOCAL)
 The ID of the page'S latest revision. More...
 
 getTouched ()
 Timestamp at which the page was last rerendered. More...
 
 isNew ()
 False if the page has had more than one edit. More...
 
 isRedirect ()
 True if the page is a redirect. More...
 
- Public Member Functions inherited from Page\PageIdentityValue
 __construct (int $pageId, int $namespace, string $dbKey, $wikiId)
 
 canExist ()
 
 exists ()
 Returns whether the page currently exists. More...
 
 getId ( $wikiId=self::LOCAL)
 The numerical page ID provided to the constructor. More...
 
- Public Member Functions inherited from Page\PageReferenceValue
 __construct (int $namespace, string $dbKey, $wikiId)
 
 __toString ()
 Returns a string representation of the title, for logging. More...
 
 getDBkey ()
 Get the page title in DB key form.
Note
This may return a string starting with a hash, if the PageReference represents the target of a block or unblock operation. This is due to the way the block target is represented in the logging table. This is intended to change in the future.
This may return an empty string, if this PageReference is a Title that represents a relative section link. This is intended to change in the future.
Returns
string
More...
 
 getNamespace ()
 Returns the page's namespace number.The value returned by this method should represent a valid namespace, but this cannot be guaranteed in all cases.
Returns
int
More...
 
 getWikiId ()
 Get the ID of the wiki provided to the constructor. More...
 
 isSamePageAs (PageReference $other)
 
- Public Member Functions inherited from MediaWiki\DAO\WikiAwareEntity
 assertWiki ( $wikiId)
 Throws if $wikiId is different from the return value of getWikiId(). More...
 
- Public Member Functions inherited from Page\ProperPageIdentity
 getDBkey ()
 Get the page title in DB key form. More...
 
 getWikiId ()
 Get the ID of the wiki this page belongs to. More...
 
- Public Member Functions inherited from Page\ExistingPageRecord
 exists ()
 Always true. More...
 

Public Attributes

const REQUIRED_FIELDS
 Fields that must be present in the row object passed to the constructor. More...
 

Private Attributes

stdClass $row
 Fields from the page table. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Page\PageIdentityValue
static localIdentity (int $pageId, int $namespace, string $dbKey)
 Create PageIdentity for a local page. More...
 
static tryNew (int $pageId, int $namespace, string $dbKey, $wikiId)
 Constructs a PageIdentityValue, or returns null if the parameters are not valid. More...
 
- Static Public Member Functions inherited from Page\PageReferenceValue
static localReference (int $namespace, string $dbKey)
 Create PageReference for a local page. More...
 

Detailed Description

Immutable data record representing an editable page on a wiki.

Corresponds to a row in the page table.

Since
1.36

Definition at line 33 of file PageStoreRecord.php.

Constructor & Destructor Documentation

◆ __construct()

Page\PageStoreRecord::__construct ( stdClass  $row,
  $wikiId 
)

The $row object must provide all fields listed in PageStoreRecord::REQUIRED_FIELDS.

Parameters
stdClass$rowA row from the page table
string | bool$wikiIdThe Id of the wiki this page belongs to, or self::LOCAL for the local wiki.

Definition at line 65 of file PageStoreRecord.php.

References Page\PageStoreRecord\$row, and Page\PageReferenceValue\$wikiId.

Member Function Documentation

◆ getLanguage()

Page\PageStoreRecord::getLanguage ( )

Language in which the page is written.

Returns
?string

Implements Page\PageRecord.

Definition at line 121 of file PageStoreRecord.php.

◆ getLatest()

Page\PageStoreRecord::getLatest (   $wikiId = self::LOCAL)

The ID of the page'S latest revision.

Parameters
bool$wikiId
Returns
int

Implements Page\PageRecord.

Definition at line 102 of file PageStoreRecord.php.

References Page\PageReferenceValue\$wikiId, and MediaWiki\DAO\WikiAwareEntity\assertWiki().

◆ getTouched()

Page\PageStoreRecord::getTouched ( )

Timestamp at which the page was last rerendered.

Returns
string

Implements Page\PageRecord.

Definition at line 112 of file PageStoreRecord.php.

◆ isNew()

Page\PageStoreRecord::isNew ( )

False if the page has had more than one edit.

Returns
bool

Implements Page\PageRecord.

Definition at line 82 of file PageStoreRecord.php.

◆ isRedirect()

Page\PageStoreRecord::isRedirect ( )

True if the page is a redirect.

Returns
bool

Implements Page\PageRecord.

Definition at line 91 of file PageStoreRecord.php.

Member Data Documentation

◆ $row

stdClass Page\PageStoreRecord::$row
private

Fields from the page table.

Definition at line 56 of file PageStoreRecord.php.

Referenced by Page\PageStoreRecord\__construct().

◆ REQUIRED_FIELDS

const Page\PageStoreRecord::REQUIRED_FIELDS
Initial value:
= [
'page_id',
'page_namespace',
'page_title',
'page_is_redirect',
'page_is_new',
'page_latest',
'page_touched',
]

Fields that must be present in the row object passed to the constructor.

Note that page_lang is optional, so it is not included here.

Since
1.37

Definition at line 41 of file PageStoreRecord.php.


The documentation for this class was generated from the following file: