MediaWiki 1.42.1
RevisionItem Class Reference

Item class for a live revision table row. More...

Inherits RevisionItemBase.

Inherited by ChangeTagsRevisionItem.

Collaboration diagram for RevisionItem:

Public Member Functions

 __construct (RevisionListBase $list, $row)
 
Parameters
RevisionListBase$list
stdClass$rowDB result row

 
 canView ()
 Returns true if the current user can view the item.
Returns
bool

 
 canViewContent ()
 Returns true if the current user can view the item text/file.
Returns
bool

 
 getAuthorIdField ()
 Get the DB field name storing user ids.Override this function.

Returns
string|false

 
 getAuthorNameField ()
 Get the DB field name storing user names.Override this function.

Returns
string|false

 
 getHTML ()
 
 getIdField ()
 Get the DB field name associated with the ID list.Override this function.

Returns
string|null

 
 getTimestampField ()
 Get the DB field name storing timestamps.Override this function.

Returns
string|false

 
 isDeleted ()
 
- Public Member Functions inherited from RevisionItemBase
 formatDate ()
 Get the date, formatted in user's language.
 
 formatTime ()
 Get the time, formatted in user's language.
 
 getAuthorActor ()
 Get the author actor ID.
 
 getAuthorActorField ()
 Get the DB field name storing actor ids.
 
 getAuthorId ()
 Get the author user ID.
 
 getAuthorName ()
 Get the author user name.
 
 getId ()
 Get the ID, as it would appear in the ids URL parameter.
 
 getTimestamp ()
 Get the timestamp in MW 14-char form.
 

Protected Member Functions

 getDiffLink ()
 Get the HTML link to the diff.
 
 getRevisionLink ()
 Get the HTML link to the revision text.
 
 getRevisionRecord ()
 Get the RevisionRecord for the item.
 
- Protected Member Functions inherited from RevisionItemBase
 getLinkRenderer ()
 Returns an instance of LinkRenderer.
 

Protected Attributes

RequestContext $context
 
RevisionRecord $revisionRecord
 
- Protected Attributes inherited from RevisionItemBase
RevisionListBase $list
 The parent.
 
stdClass $row
 The database result row.
 

Detailed Description

Item class for a live revision table row.

Definition at line 31 of file RevisionItem.php.

Constructor & Destructor Documentation

◆ __construct()

RevisionItem::__construct ( RevisionListBase $list,
$row )

Parameters
RevisionListBase$list
stdClass$rowDB result row

Reimplemented from RevisionItemBase.

Definition at line 39 of file RevisionItem.php.

References RevisionItemBase\$list, RevisionItemBase\$row, and MediaWiki\Context\ContextSource\getContext().

Member Function Documentation

◆ canView()

RevisionItem::canView ( )

Returns true if the current user can view the item.

Returns
bool

Reimplemented from RevisionItemBase.

Definition at line 77 of file RevisionItem.php.

◆ canViewContent()

RevisionItem::canViewContent ( )

Returns true if the current user can view the item text/file.

Returns
bool

Reimplemented from RevisionItemBase.

Definition at line 85 of file RevisionItem.php.

◆ getAuthorIdField()

RevisionItem::getAuthorIdField ( )

Get the DB field name storing user ids.Override this function.

Returns
string|false

Reimplemented from RevisionItemBase.

Definition at line 67 of file RevisionItem.php.

◆ getAuthorNameField()

RevisionItem::getAuthorNameField ( )

Get the DB field name storing user names.Override this function.

Returns
string|false

Reimplemented from RevisionItemBase.

Definition at line 72 of file RevisionItem.php.

◆ getDiffLink()

RevisionItem::getDiffLink ( )
protected

Get the HTML link to the diff.

Todo
Essentially a copy of RevDelRevisionItem::getDiffLink. That class should inherit from this one, and implement an appropriate interface instead of extending RevDelItem
Returns
string HTML

Definition at line 133 of file RevisionItem.php.

Referenced by ChangeTagsRevisionItem\getHTML().

◆ getHTML()

RevisionItem::getHTML ( )
Todo
Essentially a copy of RevDelRevisionItem::getHTML. That class should inherit from this one, and implement an appropriate interface instead of extending RevDelItem
Returns
string HTML

Reimplemented from RevisionItemBase.

Reimplemented in ChangeTagsRevisionItem.

Definition at line 157 of file RevisionItem.php.

◆ getIdField()

RevisionItem::getIdField ( )

Get the DB field name associated with the ID list.Override this function.

Returns
string|null

Reimplemented from RevisionItemBase.

Definition at line 57 of file RevisionItem.php.

◆ getRevisionLink()

RevisionItem::getRevisionLink ( )
protected

Get the HTML link to the revision text.

Todo
Essentially a copy of RevDelRevisionItem::getRevisionLink. That class should inherit from this one, and implement an appropriate interface instead of extending RevDelItem
Returns
string HTML

Definition at line 106 of file RevisionItem.php.

Referenced by ChangeTagsRevisionItem\getHTML().

◆ getRevisionRecord()

RevisionItem::getRevisionRecord ( )
protected

Get the RevisionRecord for the item.

Returns
RevisionRecord

Definition at line 52 of file RevisionItem.php.

Referenced by ChangeTagsRevisionItem\getHTML().

◆ getTimestampField()

RevisionItem::getTimestampField ( )

Get the DB field name storing timestamps.Override this function.

Returns
string|false

Reimplemented from RevisionItemBase.

Definition at line 62 of file RevisionItem.php.

◆ isDeleted()

RevisionItem::isDeleted ( )
Returns
bool

Definition at line 95 of file RevisionItem.php.

Referenced by ChangeTagsRevisionItem\getHTML().

Member Data Documentation

◆ $context

RequestContext RevisionItem::$context
protected

Definition at line 36 of file RevisionItem.php.

◆ $revisionRecord

RevisionRecord RevisionItem::$revisionRecord
protected

Definition at line 33 of file RevisionItem.php.


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