Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96199838
DifferentialRevisionReclaimTransaction.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
Mon, Dec 23, 17:25
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Dec 25, 17:25 (2 d)
Engine
blob
Format
Raw Data
Handle
23142656
Attached To
rPH Phabricator
DifferentialRevisionReclaimTransaction.php
View Options
<?php
final
class
DifferentialRevisionReclaimTransaction
extends
DifferentialRevisionActionTransaction
{
const
TRANSACTIONTYPE
=
'differential.revision.reclaim'
;
const
ACTIONKEY
=
'reclaim'
;
protected
function
getRevisionActionLabel
()
{
return
pht
(
'Reclaim Revision'
);
}
protected
function
getRevisionActionDescription
(
DifferentialRevision
$revision
)
{
return
pht
(
'This revision will be reclaimed and reopened.'
);
}
public
function
getIcon
()
{
return
'fa-bullhorn'
;
}
public
function
getColor
()
{
return
'sky'
;
}
protected
function
getRevisionActionOrder
()
{
return
600
;
}
public
function
getActionName
()
{
return
pht
(
'Reclaimed'
);
}
public
function
getCommandKeyword
()
{
return
'reclaim'
;
}
public
function
getCommandAliases
()
{
return
array
();
}
public
function
getCommandSummary
()
{
return
pht
(
'Reclaim a revision.'
);
}
public
function
generateOldValue
(
$object
)
{
return
!
$object
->
isAbandoned
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$status_review
=
DifferentialRevisionStatus
::
NEEDS_REVIEW
;
$object
->
setModernRevisionStatus
(
$status_review
);
}
protected
function
validateAction
(
$object
,
PhabricatorUser
$viewer
)
{
if
(!
$object
->
isAbandoned
())
{
throw
new
Exception
(
pht
(
'You can not reclaim this revision because it has not been '
.
'abandoned. Only abandoned revisions can be reclaimed.'
));
}
if
(!
$this
->
isViewerRevisionAuthor
(
$object
,
$viewer
))
{
throw
new
Exception
(
pht
(
'You can not reclaim this revision because you are not the '
.
'revision author. You can only reclaim revisions you own.'
));
}
}
public
function
getTitle
()
{
return
pht
(
'%s reclaimed this revision.'
,
$this
->
renderAuthor
());
}
public
function
getTitleForFeed
()
{
return
pht
(
'%s reclaimed %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
}
Event Timeline
Log In to Comment