Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101172390
DifferentialRevisionInlineTransaction.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
Thu, Feb 6, 11:17
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Feb 8, 11:17 (2 d)
Engine
blob
Format
Raw Data
Handle
24106212
Attached To
rPH Phabricator
DifferentialRevisionInlineTransaction.php
View Options
<?php
final
class
DifferentialRevisionInlineTransaction
extends
PhabricatorModularTransactionType
{
// NOTE: This class is NOT an actual Differential modular transaction type!
// It does not extend "DifferentialRevisionTransactionType". Some day it
// should, but for now it's just reducing the amount of hackiness around
// supporting inline comments in the "transaction.search" Conduit API method.
const
TRANSACTIONTYPE
=
'internal.pretend-inline'
;
public
function
getTransactionTypeForConduit
(
$xaction
)
{
return
'inline'
;
}
public
function
loadTransactionTypeConduitData
(
array
$xactions
)
{
$viewer
=
$this
->
getViewer
();
$changeset_ids
=
array
();
foreach
(
$xactions
as
$xaction
)
{
$changeset_ids
[]
=
$xaction
->
getComment
()->
getChangesetID
();
}
$changesets
=
id
(
new
DifferentialChangesetQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
$changeset_ids
)
->
execute
();
$changesets
=
mpull
(
$changesets
,
null
,
'getID'
);
return
$changesets
;
}
public
function
getFieldValuesForConduit
(
$object
,
$data
)
{
$comment
=
$object
->
getComment
();
$changeset
=
$data
[
$comment
->
getChangesetID
()];
$diff
=
$changeset
->
getDiff
();
return
array
(
'diff'
=>
array
(
'id'
=>
(
int
)
$diff
->
getID
(),
'phid'
=>
$diff
->
getPHID
(),
),
'path'
=>
$changeset
->
getDisplayFilename
(),
'line'
=>
(
int
)
$comment
->
getLineNumber
(),
'length'
=>
(
int
)(
$comment
->
getLineLength
()
+
1
),
'replyToCommentPHID'
=>
$comment
->
getReplyToCommentPHID
(),
);
}
}
Event Timeline
Log In to Comment