36 $this->lockFile = RepoGroup::singleton()->getLocalRepo()->newFile(
$row->fa_name );
48 return 'fa_timestamp';
56 return 'fa_user_text';
64 return $this->row->fa_id;
69 $dbw->update(
'filearchive',
70 [
'fa_deleted' => $bits ],
72 'fa_id' => $this->row->fa_id,
73 'fa_deleted' => $this->getBits(),
78 return (
bool)$dbw->affectedRows();
82 $date = $this->list->getLanguage()->userTimeAndDate(
83 $this->file->getTimestamp(), $this->list->getUser() );
87 $link = htmlspecialchars( $date );
89 $undelete = SpecialPage::getTitleFor(
'Undelete' );
90 $key = $this->file->getKey();
93 'target' => $this->list->title->getPrefixedText(),
95 'token' => $this->list->getUser()->getEditToken( $key )
100 $link =
'<span class="history-deleted">' . $link .
'</span>';
108 $user = $this->list->
getUser();
110 'title' => $this->list->title->getPrefixedText(),
115 'userhidden' => (bool)
$file->
isDeleted( RevisionRecord::DELETED_USER ),
116 'commenthidden' => (bool)
$file->
isDeleted( RevisionRecord::DELETED_COMMENT ),
117 'contenthidden' => (bool)$this->
isDeleted(),
121 'url' => SpecialPage::getTitleFor(
'Revisiondelete' )->getLinkURL(
123 'target' => $this->list->title->getPrefixedText(),
124 'file' =>
$file->getKey(),
125 'token' => $user->getEditToken(
$file->getKey() )
130 if (
$file->
userCan( RevisionRecord::DELETED_USER, $user ) ) {
136 if (
$file->
userCan( RevisionRecord::DELETED_COMMENT, $user ) ) {
138 'comment' =>
$file->getRawDescription(),
146 return $this->lockFile->acquireFileLock();
150 return $this->lockFile->releaseFileLock();
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
This class represents the result of the API operations.
static newFromRow( $row)
Loads a file object from the filearchive table.
Class to represent a local file in the wiki's own database.
getWidth( $page=1)
Return the width of the image.
getUser( $type='text')
Returns user who uploaded the file.
getSize()
Returns the size of the image file, in bytes.
getHeight( $page=1)
Return the height of the image.
userCan( $field, User $user=null)
Determine if the current user is allowed to view a particular field of this image file,...
static initFile( $list, $row)
Create file object from $row sourced from $list.
getIdField()
Get the DB field name associated with the ID list.
getAuthorNameField()
Get the DB field name storing user names.
getApiData(ApiResult $result)
Get the return information about the revision for the API.
unlock()
Unlock the item against changes outside of the DB.
getTimestampField()
Get the DB field name storing timestamps.
setBits( $bits)
Set the visibility of the item.
getLink()
Get the link to the file.
lock()
Lock the item against changes outside of the DB.
__construct( $list, $row)
getId()
Get the ID, as it would appear in the ids URL parameter.
getAuthorActorField()
Get the DB field name storing actor ids.
getAuthorIdField()
Get the DB field name storing user ids.
Item class for an oldimage table row.
canViewContent()
Returns true if the current user can view the item text/file.
$row
The database result row.
getLinkRenderer()
Returns an instance of LinkRenderer.