Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F454507
DiffusionCommitResignTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
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
getActionName
()
{
return
pht
(
'Resigned'
);
}
public
function
generateOldValue
(
$object
)
{
$actor
=
$this
->
getActor
();
return
!
$this
->
isViewerAnyActiveAuditor
(
$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
->
isViewerAnyActiveAuditor
(
$object
,
$viewer
))
{
throw
new
Exception
(
pht
(
'You can not resign from this commit because you are not an '
.
'active 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
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 5:09 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
69573
Default Alt Text
DiffusionCommitResignTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment