Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97578669
PhabricatorFileDeleteTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jan 5, 10:22
Size
996 B
Mime Type
text/x-php
Expires
Tue, Jan 7, 10:22 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23430266
Attached To
rPH Phabricator
PhabricatorFileDeleteTransaction.php
View Options
<?php
final
class
PhabricatorFileDeleteTransaction
extends
PhabricatorFileTransactionType
{
const
TRANSACTIONTYPE
=
'file:delete'
;
public
function
generateOldValue
(
$object
)
{
return
PhabricatorFile
::
STATUS_ACTIVE
;
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$file
=
$object
;
// Mark the file for deletion, save it, and schedule a worker to
// sweep by later and pick it up.
$file
->
setIsDeleted
(
true
);
PhabricatorWorker
::
scheduleTask
(
'FileDeletionWorker'
,
array
(
'objectPHID'
=>
$file
->
getPHID
()),
array
(
'priority'
=>
PhabricatorWorker
::
PRIORITY_BULK
));
}
public
function
getIcon
()
{
return
'fa-ban'
;
}
public
function
getColor
()
{
return
'red'
;
}
public
function
getTitle
()
{
return
pht
(
'%s deleted this file.'
,
$this
->
renderAuthor
());
}
public
function
getTitleForFeed
()
{
return
pht
(
'%s deleted %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
}
Event Timeline
Log In to Comment