MediaWiki  master
RevisionItemBase Class Reference

Abstract base class for revision items. More...

Inheritance diagram for RevisionItemBase:
Collaboration diagram for RevisionItemBase:

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...
 
 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...
 
 getAuthorIdField ()
 Get the DB field name storing user ids. More...
 
 getAuthorName ()
 Get the author user name. More...
 
 getAuthorNameField ()
 Get the DB field name storing user names. More...
 
 getHTML ()
 Get the HTML of the list item. More...
 
 getId ()
 Get the ID, as it would appear in the ids URL parameter. More...
 
 getIdField ()
 Get the DB field name associated with the ID list. More...
 
 getTimestamp ()
 Get the timestamp in MW 14-char form. More...
 
 getTimestampField ()
 Get the DB field name storing timestamps. More...
 

Protected Member Functions

 getLinkRenderer ()
 Returns an instance of LinkRenderer. More...
 

Protected Attributes

RevisionListBase $list
 The parent. More...
 
stdClass $row
 The database result row. More...
 

Detailed Description

Abstract base class for revision items.

Definition at line 29 of file RevisionItemBase.php.

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented in RevisionItem, RevDelRevisionItem, RevDelFileItem, and RevDelArchivedFileItem.

Definition at line 40 of file RevisionItemBase.php.

References $list, and $row.

Member Function Documentation

◆ canView()

RevisionItemBase::canView ( )
abstract

Returns true if the current user can view the item.

Returns
bool

Reimplemented in RevisionItem, RevDelRevisionItem, RevDelLogItem, RevDelFileItem, and ChangeTagsLogItem.

◆ canViewContent()

RevisionItemBase::canViewContent ( )
abstract

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

Returns
bool

Reimplemented in RevisionItem, RevDelRevisionItem, RevDelLogItem, RevDelFileItem, and ChangeTagsLogItem.

◆ formatDate()

RevisionItemBase::formatDate ( )

Get the date, formatted in user's language.

Returns
string

Definition at line 104 of file RevisionItemBase.php.

References getTimestamp().

◆ formatTime()

RevisionItemBase::formatTime ( )

Get the time, formatted in user's language.

Returns
string

Definition at line 113 of file RevisionItemBase.php.

References getTimestamp().

◆ getAuthorActor()

RevisionItemBase::getAuthorActor ( )

Get the author actor ID.

Since
1.31
Returns
string

Definition at line 150 of file RevisionItemBase.php.

References getAuthorActorField().

◆ getAuthorActorField()

RevisionItemBase::getAuthorActorField ( )

Get the DB field name storing actor ids.

Override this function.

Since
1.31
Returns
string|false

Reimplemented in RevDelRevisionItem, RevDelLogItem, RevDelFileItem, RevDelArchiveItem, RevDelArchivedFileItem, and ChangeTagsLogItem.

Definition at line 87 of file RevisionItemBase.php.

Referenced by getAuthorActor().

◆ getAuthorId()

RevisionItemBase::getAuthorId ( )

Get the author user ID.

Returns
int

Definition at line 131 of file RevisionItemBase.php.

References getAuthorIdField().

◆ getAuthorIdField()

RevisionItemBase::getAuthorIdField ( )

Get the DB field name storing user ids.

Override this function.

Returns
string|false

Reimplemented in RevisionItem, RevDelRevisionItem, RevDelLogItem, RevDelFileItem, RevDelArchiveItem, RevDelArchivedFileItem, and ChangeTagsLogItem.

Definition at line 68 of file RevisionItemBase.php.

Referenced by getAuthorId().

◆ getAuthorName()

RevisionItemBase::getAuthorName ( )

Get the author user name.

Returns
string

Definition at line 140 of file RevisionItemBase.php.

References getAuthorNameField().

◆ getAuthorNameField()

RevisionItemBase::getAuthorNameField ( )

Get the DB field name storing user names.

Override this function.

Returns
string|false

Reimplemented in RevisionItem, RevDelRevisionItem, RevDelLogItem, RevDelFileItem, RevDelArchiveItem, RevDelArchivedFileItem, and ChangeTagsLogItem.

Definition at line 77 of file RevisionItemBase.php.

Referenced by getAuthorName().

◆ getHTML()

RevisionItemBase::getHTML ( )
abstract

Get the HTML of the list item.

Should be include "<li></li>" tags. This is used to show the list in HTML form, by the special page.

Returns
string HTML

Reimplemented in RevisionItem, RevDelRevisionItem, RevDelLogItem, RevDelFileItem, ChangeTagsRevisionItem, and ChangeTagsLogItem.

◆ getId()

RevisionItemBase::getId ( )

Get the ID, as it would appear in the ids URL parameter.

Returns
int

Reimplemented in RevDelFileItem, RevDelArchiveItem, RevDelArchivedRevisionItem, and RevDelArchivedFileItem.

Definition at line 95 of file RevisionItemBase.php.

References getIdField().

Referenced by RevDelRevisionItem\isHideCurrentOp().

◆ getIdField()

RevisionItemBase::getIdField ( )

Get the DB field name associated with the ID list.

Override this function.

Returns
string|null

Reimplemented in RevisionItem, RevDelRevisionItem, RevDelLogItem, RevDelFileItem, RevDelArchiveItem, RevDelArchivedRevisionItem, RevDelArchivedFileItem, and ChangeTagsLogItem.

Definition at line 50 of file RevisionItemBase.php.

Referenced by getId().

◆ getLinkRenderer()

◆ getTimestamp()

RevisionItemBase::getTimestamp ( )

Get the timestamp in MW 14-char form.

Returns
string|false

Definition at line 122 of file RevisionItemBase.php.

References getTimestampField(), and wfTimestamp().

Referenced by formatDate(), formatTime(), and RevDelRevisionItem\getRevisionLink().

◆ getTimestampField()

RevisionItemBase::getTimestampField ( )

Get the DB field name storing timestamps.

Override this function.

Returns
string|false

Reimplemented in RevisionItem, RevDelRevisionItem, RevDelLogItem, RevDelFileItem, RevDelArchiveItem, RevDelArchivedFileItem, and ChangeTagsLogItem.

Definition at line 59 of file RevisionItemBase.php.

Referenced by getTimestamp().

Member Data Documentation

◆ $list

RevisionListBase RevisionItemBase::$list
protected

◆ $row


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