MediaWiki REL1_37
RevDelFileItem Class Reference

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

Inheritance diagram for RevDelFileItem:
Collaboration diagram for RevDelFileItem:

Public Member Functions

 __construct (RevisionListBase $list, $row)
 
 canView ()
 Returns true if the current user can view the item.
 
 canViewContent ()
 Returns true if the current user can view the item text/file.
 
 getApiData (ApiResult $result)
 Get the return information about the revision for the API.
 
 getAuthorActorField ()
 Get the DB field name storing actor ids.
 
 getAuthorIdField ()
 Get the DB field name storing user ids.
 
 getAuthorNameField ()
 Get the DB field name storing user names.
 
 getBits ()
 Get the current deletion bitfield value.
 
 getHTML ()
 Get the HTML of the list item.
 
 getId ()
 Get the ID, as it would appear in the ids URL parameter.
 
 getIdField ()
 Get the DB field name associated with the ID list.
 
 getTimestampField ()
 Get the DB field name storing timestamps.
 
 isDeleted ()
 
 lock ()
 Lock the item against changes outside of the DB.
 
 setBits ( $bits)
 Set the visibility of the item.
 
 unlock ()
 Unlock the item against changes outside of the DB.
 
- Public Member Functions inherited from 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 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 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

OldLocalFile $file
 
RevDelFileList $list
 
- Protected Attributes inherited from RevisionItemBase
RevisionListBase $list
 The parent.
 
stdClass $row
 The database result row.
 

Detailed Description

Item class for an oldimage table row.

Definition at line 28 of file RevDelFileItem.php.

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from RevisionItemBase.

Reimplemented in RevDelArchivedFileItem.

Definition at line 34 of file RevDelFileItem.php.

References $list, and RevisionItemBase\$row.

Member Function Documentation

◆ canView()

RevDelFileItem::canView ( )

Returns true if the current user can view the item.

Returns
bool

Reimplemented from RevisionItemBase.

Definition at line 77 of file RevDelFileItem.php.

◆ canViewContent()

RevDelFileItem::canViewContent ( )

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

Returns
bool

Reimplemented from RevisionItemBase.

Definition at line 81 of file RevDelFileItem.php.

Referenced by RevDelArchivedFileItem\getApiData(), getApiData(), RevDelArchivedFileItem\getLink(), and getLink().

◆ getApiData()

RevDelFileItem::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

Reimplemented from RevDelItem.

Reimplemented in RevDelArchivedFileItem.

Definition at line 216 of file RevDelFileItem.php.

References $file, canViewContent(), OldLocalFile\getArchiveName(), LocalFile\getDescription(), LocalFile\getHeight(), LocalFile\getSize(), LocalFile\getTimestamp(), SpecialPage\getTitleFor(), LocalFile\getUploader(), File\getUrl(), File\getUser(), LocalFile\getWidth(), OldLocalFile\isDeleted(), isDeleted(), and wfTimestamp().

◆ getAuthorActorField()

RevDelFileItem::getAuthorActorField ( )

Get the DB field name storing actor ids.

Override this function.

Since
1.31
Returns
string|false

Reimplemented from RevisionItemBase.

Reimplemented in RevDelArchivedFileItem.

Definition at line 67 of file RevDelFileItem.php.

◆ getAuthorIdField()

RevDelFileItem::getAuthorIdField ( )

Get the DB field name storing user ids.

Override this function.

Returns
string|false

Reimplemented from RevisionItemBase.

Reimplemented in RevDelArchivedFileItem.

Definition at line 59 of file RevDelFileItem.php.

◆ getAuthorNameField()

RevDelFileItem::getAuthorNameField ( )

Get the DB field name storing user names.

Override this function.

Returns
string|false

Reimplemented from RevisionItemBase.

Reimplemented in RevDelArchivedFileItem.

Definition at line 63 of file RevDelFileItem.php.

◆ getBits()

RevDelFileItem::getBits ( )

Get the current deletion bitfield value.

Returns
int

Reimplemented from RevDelItem.

Definition at line 85 of file RevDelFileItem.php.

◆ getComment()

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 191 of file RevDelFileItem.php.

References Linker\commentBlock().

Referenced by getHTML().

◆ getHTML()

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 RevisionItemBase.

Definition at line 204 of file RevDelFileItem.php.

References getComment(), getLink(), and getUserTools().

◆ getId()

RevDelFileItem::getId ( )

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

Returns
int

Reimplemented from RevisionItemBase.

Reimplemented in RevDelArchivedFileItem.

Definition at line 71 of file RevDelFileItem.php.

◆ getIdField()

RevDelFileItem::getIdField ( )

Get the DB field name associated with the ID list.

Override this function.

Returns
string|null

Reimplemented from RevisionItemBase.

Reimplemented in RevDelArchivedFileItem.

Definition at line 51 of file RevDelFileItem.php.

◆ getLink()

RevDelFileItem::getLink ( )
protected

Get the link to the file.

Overridden by RevDelArchivedFileItem.

Returns
string

Reimplemented in RevDelArchivedFileItem.

Definition at line 137 of file RevDelFileItem.php.

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

Referenced by getHTML().

◆ getTimestampField()

RevDelFileItem::getTimestampField ( )

Get the DB field name storing timestamps.

Override this function.

Returns
string|false

Reimplemented from RevisionItemBase.

Reimplemented in RevDelArchivedFileItem.

Definition at line 55 of file RevDelFileItem.php.

◆ getUserTools()

RevDelFileItem::getUserTools ( )
protected

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

Returns
string HTML

Definition at line 170 of file RevDelFileItem.php.

References Linker\userLink(), and Linker\userToolLinks().

Referenced by getHTML().

◆ initFile()

static RevDelFileItem::initFile (   $list,
  $row 
)
staticprotected

Create file object from $row sourced from $list.

Parameters
RevisionListBase$list
mixed$row
Returns
mixed

Reimplemented in RevDelArchivedFileItem.

Definition at line 46 of file RevDelFileItem.php.

References RevisionItemBase\$row.

◆ isDeleted()

RevDelFileItem::isDeleted ( )

◆ lock()

RevDelFileItem::lock ( )

Lock the item against changes outside of the DB.

Returns
Status
Since
1.28

Reimplemented from RevDelItem.

Reimplemented in RevDelArchivedFileItem.

Definition at line 262 of file RevDelFileItem.php.

◆ setBits()

RevDelFileItem::setBits (   $newBits)

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 RevDelItem.

Reimplemented in RevDelArchivedFileItem.

Definition at line 89 of file RevDelFileItem.php.

References DB_PRIMARY, isDeleted(), and wfGetDB().

◆ unlock()

RevDelFileItem::unlock ( )

Unlock the item against changes outside of the DB.

Returns
Status
Since
1.28

Reimplemented from RevDelItem.

Reimplemented in RevDelArchivedFileItem.

Definition at line 266 of file RevDelFileItem.php.

Member Data Documentation

◆ $file

OldLocalFile RevDelFileItem::$file
protected

Definition at line 32 of file RevDelFileItem.php.

Referenced by RevDelArchivedFileItem\getApiData(), and getApiData().

◆ $list

RevDelFileList RevDelFileItem::$list
protected

Definition at line 30 of file RevDelFileItem.php.

Referenced by RevDelArchivedFileItem\__construct(), and __construct().


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