Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / files / xaction / PhabricatorFileDeleteTransaction.php
blobd0b2c942c4f60d24404166271bd6c06ebba46a83
1 <?php
3 final class PhabricatorFileDeleteTransaction
4 extends PhabricatorFileTransactionType {
6 const TRANSACTIONTYPE = 'file:delete';
8 public function generateOldValue($object) {
9 return PhabricatorFile::STATUS_ACTIVE;
12 public function applyInternalEffects($object, $value) {
13 $file = $object;
14 // Mark the file for deletion, save it, and schedule a worker to
15 // sweep by later and pick it up.
16 $file->setIsDeleted(true);
18 PhabricatorWorker::scheduleTask(
19 'FileDeletionWorker',
20 array('objectPHID' => $file->getPHID()),
21 array('priority' => PhabricatorWorker::PRIORITY_BULK));
24 public function getIcon() {
25 return 'fa-ban';
28 public function getColor() {
29 return 'red';
32 public function getTitle() {
33 return pht(
34 '%s deleted this file.',
35 $this->renderAuthor());
38 public function getTitleForFeed() {
39 return pht(
40 '%s deleted %s.',
41 $this->renderAuthor(),
42 $this->renderObject());