MediaWiki  master
RevisionItem Class Reference

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

Inheritance diagram for RevisionItem:
Collaboration diagram for RevisionItem:

Public Member Functions

 __construct (RevisionListBase $list, $row)
 
 canView ()
 Returns true if the current user can view the item. More...
 
 canViewContent ()
 Returns true if the current user can view the item text/file. More...
 
 getAuthorIdField ()
 Get the DB field name storing user ids. More...
 
 getAuthorNameField ()
 Get the DB field name storing user names. More...
 
 getHTML ()
 
 getIdField ()
 Get the DB field name associated with the ID list. More...
 
 getTimestampField ()
 Get the DB field name storing timestamps. More...
 
 isDeleted ()
 
- Public Member Functions inherited from RevisionItemBase
 formatDate ()
 Get the date, formatted in user's language. More...
 
 formatTime ()
 Get the time, formatted in user's language. More...
 
 getAuthorActor ()
 Get the author actor ID. More...
 
 getAuthorActorField ()
 Get the DB field name storing actor ids. More...
 
 getAuthorId ()
 Get the author user ID. More...
 
 getAuthorName ()
 Get the author user name. More...
 
 getId ()
 Get the ID, as it would appear in the ids URL parameter. More...
 
 getTimestamp ()
 Get the timestamp in MW 14-char form. More...
 

Protected Member Functions

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

Protected Attributes

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

Detailed Description

Item class for a live revision table row.

Definition at line 29 of file RevisionItem.php.

Constructor & Destructor Documentation

◆ __construct()

RevisionItem::__construct ( RevisionListBase  $list,
  $row 
)
Parameters
RevisionListBase$list
object$rowDB result row

Reimplemented from RevisionItemBase.

Definition at line 36 of file RevisionItem.php.

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

Member Function Documentation

◆ canView()

RevisionItem::canView ( )

Returns true if the current user can view the item.

Reimplemented from RevisionItemBase.

Definition at line 69 of file RevisionItem.php.

References getRevisionRecord().

◆ canViewContent()

RevisionItem::canViewContent ( )

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

Reimplemented from RevisionItemBase.

Definition at line 77 of file RevisionItem.php.

References getRevisionRecord().

Referenced by getDiffLink(), and getRevisionLink().

◆ getAuthorIdField()

RevisionItem::getAuthorIdField ( )

Get the DB field name storing user ids.

Override this function.

Returns
string|bool

Reimplemented from RevisionItemBase.

Definition at line 61 of file RevisionItem.php.

◆ getAuthorNameField()

RevisionItem::getAuthorNameField ( )

Get the DB field name storing user names.

Override this function.

Returns
string|bool

Reimplemented from RevisionItemBase.

Definition at line 65 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

Definition at line 123 of file RevisionItem.php.

References canViewContent(), RevisionItemBase\getLinkRenderer(), and isDeleted().

Referenced by ChangeTagsRevisionItem\getHTML(), and 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

Reimplemented from RevisionItemBase.

Reimplemented in ChangeTagsRevisionItem.

Definition at line 147 of file RevisionItem.php.

References getDiffLink(), getRevisionLink(), getRevisionRecord(), isDeleted(), Linker\revComment(), and Linker\revUserLink().

◆ 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 53 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

Definition at line 96 of file RevisionItem.php.

References canViewContent(), RevisionItemBase\getLinkRenderer(), getRevisionRecord(), and isDeleted().

Referenced by ChangeTagsRevisionItem\getHTML(), and getHTML().

◆ getRevisionRecord()

RevisionItem::getRevisionRecord ( )
protected

Get the RevisionRecord for the item.

Returns
RevisionRecord

Definition at line 49 of file RevisionItem.php.

References $revisionRecord.

Referenced by canView(), canViewContent(), ChangeTagsRevisionItem\getHTML(), getHTML(), getRevisionLink(), and isDeleted().

◆ getTimestampField()

RevisionItem::getTimestampField ( )

Get the DB field name storing timestamps.

Override this function.

Returns
string|bool

Reimplemented from RevisionItemBase.

Definition at line 57 of file RevisionItem.php.

◆ isDeleted()

RevisionItem::isDeleted ( )

Member Data Documentation

◆ $context

RequestContext RevisionItem::$context
protected

Definition at line 34 of file RevisionItem.php.

◆ $revisionRecord

RevisionRecord RevisionItem::$revisionRecord
protected

Definition at line 31 of file RevisionItem.php.

Referenced by getRevisionRecord().


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