Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93174314
DiffusionCommitResignTransaction.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 26, 18:46
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 28, 18:46 (2 d)
Engine
blob
Format
Raw Data
Handle
22586170
Attached To
rPH Phabricator
DiffusionCommitResignTransaction.php
View Options
<?php
final
class
DiffusionCommitResignTransaction
extends
DiffusionCommitAuditTransaction
{
const
TRANSACTIONTYPE
=
'diffusion.commit.resign'
;
const
ACTIONKEY
=
'resign'
;
protected
function
getCommitActionLabel
()
{
return
pht
(
'Resign as Auditor'
);
}
protected
function
getCommitActionDescription
()
{
return
pht
(
'You will resign as an auditor for this commit.'
);
}
public
function
getIcon
()
{
return
'fa-flag'
;
}
public
function
getColor
()
{
return
'orange'
;
}
protected
function
getCommitActionOrder
()
{
return
700
;
}
public
function
generateOldValue
(
$object
)
{
$actor
=
$this
->
getActor
();
return
!
$this
->
isViewerAnyAuditor
(
$object
,
$actor
);
}
public
function
applyExternalEffects
(
$object
,
$value
)
{
$status
=
PhabricatorAuditStatusConstants
::
RESIGNED
;
$actor
=
$this
->
getActor
();
$this
->
applyAuditorEffect
(
$object
,
$actor
,
$value
,
$status
);
}
protected
function
validateAction
(
$object
,
PhabricatorUser
$viewer
)
{
if
(!
$this
->
isViewerAnyAuditor
(
$object
,
$viewer
))
{
throw
new
Exception
(
pht
(
'You can not resign from this commit because you are not an '
.
'auditor.'
));
}
}
public
function
getTitle
()
{
return
pht
(
'%s resigned from this commit.'
,
$this
->
renderAuthor
());
}
public
function
getTitleForFeed
()
{
return
pht
(
'%s resigned from %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
}
Event Timeline
Log In to Comment