Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97004550
DifferentialRevisionStatusTransaction.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
Wed, Jan 1, 13:26
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jan 3, 13:26 (2 d)
Engine
blob
Format
Raw Data
Handle
23310668
Attached To
rPH Phabricator
DifferentialRevisionStatusTransaction.php
View Options
<?php
final
class
DifferentialRevisionStatusTransaction
extends
DifferentialRevisionTransactionType
{
const
TRANSACTIONTYPE
=
'differential.revision.status'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getModernRevisionStatus
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setModernRevisionStatus
(
$value
);
}
public
function
getTitle
()
{
$status
=
$this
->
newStatusObject
();
if
(
$status
->
isAccepted
())
{
return
pht
(
'This revision is now accepted and ready to land.'
);
}
if
(
$status
->
isNeedsRevision
())
{
return
pht
(
'This revision now requires changes to proceed.'
);
}
if
(
$status
->
isNeedsReview
())
{
return
pht
(
'This revision now requires review to proceed.'
);
}
return
null
;
}
public
function
getTitleForFeed
()
{
$status
=
$this
->
newStatusObject
();
if
(
$status
->
isAccepted
())
{
return
pht
(
'%s is now accepted and ready to land.'
,
$this
->
renderObject
());
}
if
(
$status
->
isNeedsRevision
())
{
return
pht
(
'%s now requires changes to proceed.'
,
$this
->
renderObject
());
}
if
(
$status
->
isNeedsReview
())
{
return
pht
(
'%s now requires review to proceed.'
,
$this
->
renderObject
());
}
return
null
;
}
public
function
getIcon
()
{
$status
=
$this
->
newStatusObject
();
return
$status
->
getTimelineIcon
();
}
public
function
getColor
()
{
$status
=
$this
->
newStatusObject
();
return
$status
->
getTimelineColor
();
}
private
function
newStatusObject
()
{
$new
=
$this
->
getNewValue
();
return
DifferentialRevisionStatus
::
newForStatus
(
$new
);
}
public
function
getTransactionTypeForConduit
(
$xaction
)
{
return
'status'
;
}
public
function
getFieldValuesForConduit
(
$xaction
,
$data
)
{
return
array
(
'old'
=>
$xaction
->
getOldValue
(),
'new'
=>
$xaction
->
getNewValue
(),
);
}
}
Event Timeline
Log In to Comment