Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93936159
PhabricatorApplicationTransactionResponse.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
Mon, Dec 2, 15:50
Size
2 KB
Mime Type
text/x-php
Expires
Wed, Dec 4, 15:50 (2 d)
Engine
blob
Format
Raw Data
Handle
22723574
Attached To
rPH Phabricator
PhabricatorApplicationTransactionResponse.php
View Options
<?php
final
class
PhabricatorApplicationTransactionResponse
extends
AphrontProxyResponse
{
private
$viewer
;
private
$transactions
;
private
$isPreview
;
private
$transactionView
;
private
$previewContent
;
public
function
setTransactionView
(
$transaction_view
)
{
$this
->
transactionView
=
$transaction_view
;
return
$this
;
}
public
function
getTransactionView
()
{
return
$this
->
transactionView
;
}
protected
function
buildProxy
()
{
return
new
AphrontAjaxResponse
();
}
public
function
setTransactions
(
$transactions
)
{
assert_instances_of
(
$transactions
,
'PhabricatorApplicationTransaction'
);
$this
->
transactions
=
$transactions
;
return
$this
;
}
public
function
getTransactions
()
{
return
$this
->
transactions
;
}
public
function
setViewer
(
PhabricatorUser
$viewer
)
{
$this
->
viewer
=
$viewer
;
return
$this
;
}
public
function
getViewer
()
{
return
$this
->
viewer
;
}
public
function
setIsPreview
(
$is_preview
)
{
$this
->
isPreview
=
$is_preview
;
return
$this
;
}
public
function
setPreviewContent
(
$preview_content
)
{
$this
->
previewContent
=
$preview_content
;
return
$this
;
}
public
function
getPreviewContent
()
{
return
$this
->
previewContent
;
}
public
function
reduceProxyResponse
()
{
if
(
$this
->
transactionView
)
{
$view
=
$this
->
transactionView
;
}
else
if
(
$this
->
getTransactions
())
{
$view
=
head
(
$this
->
getTransactions
())
->
getApplicationTransactionViewObject
();
}
else
{
$view
=
new
PhabricatorApplicationTransactionView
();
}
$view
->
setUser
(
$this
->
getViewer
())
->
setTransactions
(
$this
->
getTransactions
())
->
setIsPreview
(
$this
->
isPreview
);
if
(
$this
->
isPreview
)
{
$xactions
=
mpull
(
$view
->
buildEvents
(),
'render'
);
}
else
{
$xactions
=
mpull
(
$view
->
buildEvents
(),
'render'
,
'getTransactionPHID'
);
}
// Force whatever the underlying views built to render into HTML for
// the Javascript.
foreach
(
$xactions
as
$key
=>
$xaction
)
{
$xactions
[
$key
]
=
hsprintf
(
'%s'
,
$xaction
);
}
$content
=
array
(
'xactions'
=>
$xactions
,
'spacer'
=>
PHUITimelineView
::
renderSpacer
(),
'previewContent'
=>
hsprintf
(
'%s'
,
$this
->
getPreviewContent
()),
);
return
$this
->
getProxy
()->
setContent
(
$content
);
}
}
Event Timeline
Log In to Comment