MediaWiki master
MediaWiki\RevisionDelete\RevDelFileItem Class Reference

Item class for an oldimage table row. More...

Inherits MediaWiki\RevisionDelete\RevDelItem.

Inherited by MediaWiki\RevisionDelete\RevDelArchivedFileItem.

Collaboration diagram for MediaWiki\RevisionDelete\RevDelFileItem:

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

 
 getApiData (ApiResult $result)
 Get the return information about the revision for the API.
Since
1.23
Parameters
ApiResult$result
Returns
array Data for the API result

 
 getAuthorActorField ()
 Get the DB field name storing actor ids.Override this function.

Since
1.31
Returns
string|false

 
 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

 
 getBits ()
 Get the current deletion bitfield value.
Returns
int

 
 getHTML ()
 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

 
 getId ()
 Get the ID, as it would appear in the ids URL parameter.
Returns
int|string

 
 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 ()
 
 lock ()
 Lock the item against changes outside of the DB.
Returns
Status
Since
1.28

 
 setBits ( $bits)
 Set the visibility of the item.This should do any necessary DB queries.The DB update query should have a condition which forces it to only update if the value in the DB matches the value fetched earlier with the SELECT. If the update fails because it did not match, the function should return false. This prevents concurrency problems.
Parameters
int$newBits
Returns
bool Success

 
 unlock ()
 Unlock the item against changes outside of the DB.
Returns
Status
Since
1.28

 
- Public Member Functions inherited from MediaWiki\RevisionDelete\RevDelItem
 isHideCurrentOp ( $newBits)
 Returns true if the item is "current", and the operation to set the given bits can't be executed for that reason STUB.
 
- Public Member Functions inherited from MediaWiki\RevisionList\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.
 
 getAuthorId ()
 Get the author user ID.
 
 getAuthorName ()
 Get the author user name.
 
 getTimestamp ()
 Get the timestamp in MW 14-char form.
 

Protected Member Functions

 getComment ()
 Wrap and format the file's comment block, if the current user is allowed to view it.
 
 getLink ()
 Get the link to the file.
 
 getUserTools ()
 Generate a user tool link cluster if the current user is allowed to view it.
 
- Protected Member Functions inherited from MediaWiki\RevisionList\RevisionItemBase
 getLinkRenderer ()
 Returns an instance of LinkRenderer.
 

Static Protected Member Functions

static initFile ( $list, $row)
 Create file object from $row sourced from $list.
 

Protected Attributes

IConnectionProvider $dbProvider
 
OldLocalFile $file
 
RevDelFileList $list
 
- Protected Attributes inherited from MediaWiki\RevisionList\RevisionItemBase
RevisionListBase $list
 The parent.
 
stdClass $row
 The database result row.
 

Detailed Description

Item class for an oldimage table row.

Definition at line 24 of file RevDelFileItem.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\RevisionDelete\RevDelFileItem::__construct ( RevisionListBase $list,
$row )

Member Function Documentation

◆ canView()

MediaWiki\RevisionDelete\RevDelFileItem::canView ( )

Returns true if the current user can view the item.

Returns
bool

Reimplemented from MediaWiki\RevisionList\RevisionItemBase.

Definition at line 83 of file RevDelFileItem.php.

◆ canViewContent()

MediaWiki\RevisionDelete\RevDelFileItem::canViewContent ( )

◆ getApiData()

◆ getAuthorActorField()

MediaWiki\RevisionDelete\RevDelFileItem::getAuthorActorField ( )

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

Since
1.31
Returns
string|false

Reimplemented from MediaWiki\RevisionList\RevisionItemBase.

Reimplemented in MediaWiki\RevisionDelete\RevDelArchivedFileItem.

Definition at line 71 of file RevDelFileItem.php.

◆ getAuthorIdField()

MediaWiki\RevisionDelete\RevDelFileItem::getAuthorIdField ( )

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

Returns
string|false

Reimplemented from MediaWiki\RevisionList\RevisionItemBase.

Reimplemented in MediaWiki\RevisionDelete\RevDelArchivedFileItem.

Definition at line 61 of file RevDelFileItem.php.

◆ getAuthorNameField()

MediaWiki\RevisionDelete\RevDelFileItem::getAuthorNameField ( )

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

Returns
string|false

Reimplemented from MediaWiki\RevisionList\RevisionItemBase.

Reimplemented in MediaWiki\RevisionDelete\RevDelArchivedFileItem.

Definition at line 66 of file RevDelFileItem.php.

◆ getBits()

MediaWiki\RevisionDelete\RevDelFileItem::getBits ( )

Get the current deletion bitfield value.

Returns
int

Reimplemented from MediaWiki\RevisionDelete\RevDelItem.

Definition at line 93 of file RevDelFileItem.php.

◆ getComment()

MediaWiki\RevisionDelete\RevDelFileItem::getComment ( )
protected

Wrap and format the file's comment block, if the current user is allowed to view it.

Returns
string HTML

Definition at line 203 of file RevDelFileItem.php.

References MediaWiki\MediaWikiServices\getInstance().

Referenced by MediaWiki\RevisionDelete\RevDelFileItem\getHTML().

◆ getHTML()

MediaWiki\RevisionDelete\RevDelFileItem::getHTML ( )

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 from MediaWiki\RevisionList\RevisionItemBase.

Definition at line 218 of file RevDelFileItem.php.

References MediaWiki\RevisionDelete\RevDelFileItem\getComment(), MediaWiki\RevisionDelete\RevDelFileItem\getLink(), and MediaWiki\RevisionDelete\RevDelFileItem\getUserTools().

◆ getId()

MediaWiki\RevisionDelete\RevDelFileItem::getId ( )

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

Returns
int|string

Reimplemented from MediaWiki\RevisionList\RevisionItemBase.

Reimplemented in MediaWiki\RevisionDelete\RevDelArchivedFileItem.

Definition at line 76 of file RevDelFileItem.php.

◆ getIdField()

MediaWiki\RevisionDelete\RevDelFileItem::getIdField ( )

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

Returns
string|null

Reimplemented from MediaWiki\RevisionList\RevisionItemBase.

Reimplemented in MediaWiki\RevisionDelete\RevDelArchivedFileItem.

Definition at line 51 of file RevDelFileItem.php.

◆ getLink()

◆ getTimestampField()

MediaWiki\RevisionDelete\RevDelFileItem::getTimestampField ( )

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

Returns
string|false

Reimplemented from MediaWiki\RevisionList\RevisionItemBase.

Reimplemented in MediaWiki\RevisionDelete\RevDelArchivedFileItem.

Definition at line 56 of file RevDelFileItem.php.

◆ getUserTools()

MediaWiki\RevisionDelete\RevDelFileItem::getUserTools ( )
protected

Generate a user tool link cluster if the current user is allowed to view it.

Returns
string HTML

Definition at line 182 of file RevDelFileItem.php.

Referenced by MediaWiki\RevisionDelete\RevDelFileItem\getHTML().

◆ initFile()

static MediaWiki\RevisionDelete\RevDelFileItem::initFile ( $list,
$row )
staticprotected

Create file object from $row sourced from $list.

Parameters
RevisionListBase$list
mixed$row
Returns
mixed

Reimplemented in MediaWiki\RevisionDelete\RevDelArchivedFileItem.

Definition at line 45 of file RevDelFileItem.php.

References MediaWiki\RevisionList\RevisionItemBase\$row, and MediaWiki\MediaWikiServices\getInstance().

◆ isDeleted()

◆ lock()

MediaWiki\RevisionDelete\RevDelFileItem::lock ( )

Lock the item against changes outside of the DB.

Returns
Status
Since
1.28

Reimplemented from MediaWiki\RevisionDelete\RevDelItem.

Reimplemented in MediaWiki\RevisionDelete\RevDelArchivedFileItem.

Definition at line 278 of file RevDelFileItem.php.

◆ setBits()

MediaWiki\RevisionDelete\RevDelFileItem::setBits ( $bits)

Set the visibility of the item.This should do any necessary DB queries.The DB update query should have a condition which forces it to only update if the value in the DB matches the value fetched earlier with the SELECT. If the update fails because it did not match, the function should return false. This prevents concurrency problems.

Parameters
int$newBits
Returns
bool Success

Reimplemented from MediaWiki\RevisionDelete\RevDelItem.

Reimplemented in MediaWiki\RevisionDelete\RevDelArchivedFileItem.

Definition at line 98 of file RevDelFileItem.php.

References MediaWiki\RevisionDelete\RevDelFileItem\isDeleted().

◆ unlock()

MediaWiki\RevisionDelete\RevDelFileItem::unlock ( )

Unlock the item against changes outside of the DB.

Returns
Status
Since
1.28

Reimplemented from MediaWiki\RevisionDelete\RevDelItem.

Reimplemented in MediaWiki\RevisionDelete\RevDelArchivedFileItem.

Definition at line 283 of file RevDelFileItem.php.

Member Data Documentation

◆ $dbProvider

IConnectionProvider MediaWiki\RevisionDelete\RevDelFileItem::$dbProvider
protected

Definition at line 29 of file RevDelFileItem.php.

◆ $file

OldLocalFile MediaWiki\RevisionDelete\RevDelFileItem::$file
protected

◆ $list

RevDelFileList MediaWiki\RevisionDelete\RevDelFileItem::$list
protected

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