Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90882943
DifferentialRevisionResignTransaction.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
Tue, Nov 5, 15:40
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 7, 15:40 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22152217
Attached To
rPH Phabricator
DifferentialRevisionResignTransaction.php
View Options
<?php
final
class
DifferentialRevisionResignTransaction
extends
DifferentialRevisionReviewTransaction
{
const
TRANSACTIONTYPE
=
'differential.revision.resign'
;
const
ACTIONKEY
=
'resign'
;
protected
function
getRevisionActionLabel
()
{
return
pht
(
'Resign as Reviewer'
);
}
protected
function
getRevisionActionDescription
()
{
return
pht
(
'You will resign as a reviewer for this change.'
);
}
public
function
getIcon
()
{
return
'fa-flag'
;
}
public
function
getColor
()
{
return
'orange'
;
}
protected
function
getRevisionActionOrder
()
{
return
700
;
}
public
function
getCommandKeyword
()
{
return
'resign'
;
}
public
function
getCommandAliases
()
{
return
array
();
}
public
function
getCommandSummary
()
{
return
pht
(
'Resign from a revision.'
);
}
public
function
generateOldValue
(
$object
)
{
$actor
=
$this
->
getActor
();
return
!
$this
->
isViewerAnyReviewer
(
$object
,
$actor
);
}
public
function
applyExternalEffects
(
$object
,
$value
)
{
$status
=
DifferentialReviewerStatus
::
STATUS_RESIGNED
;
$actor
=
$this
->
getActor
();
$this
->
applyReviewerEffect
(
$object
,
$actor
,
$value
,
$status
);
}
protected
function
validateAction
(
$object
,
PhabricatorUser
$viewer
)
{
if
(
$object
->
isClosed
())
{
throw
new
Exception
(
pht
(
'You can not resign from this revision because it has already '
.
'been closed. You can only resign from open revisions.'
));
}
if
(!
$this
->
isViewerAnyReviewer
(
$object
,
$viewer
))
{
throw
new
Exception
(
pht
(
'You can not resign from this revision because you are not a '
.
'reviewer. You can only resign from revisions where you are a '
.
'reviewer.'
));
}
}
public
function
getTitle
()
{
return
pht
(
'%s resigned from this revision.'
,
$this
->
renderAuthor
());
}
public
function
getTitleForFeed
()
{
return
pht
(
'%s resigned from %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
}
Event Timeline
Log In to Comment