Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2322167
PonderAnswerHistoryController.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
PonderAnswerHistoryController.php
View Options
<?php
final
class
PonderAnswerHistoryController
extends
PonderController
{
private
$id
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
id
=
$data
[
'id'
];
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$viewer
=
$request
->
getUser
();
$answer
=
id
(
new
PonderAnswerQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$this
->
id
))
->
executeOne
();
if
(!
$answer
)
{
return
new
Aphront404Response
();
}
$xactions
=
id
(
new
PonderAnswerTransactionQuery
())
->
setViewer
(
$viewer
)
->
withObjectPHIDs
(
array
(
$answer
->
getPHID
()))
->
execute
();
$engine
=
id
(
new
PhabricatorMarkupEngine
())
->
setViewer
(
$viewer
);
foreach
(
$xactions
as
$xaction
)
{
if
(
$xaction
->
getComment
())
{
$engine
->
addObject
(
$xaction
->
getComment
(),
PhabricatorApplicationTransactionComment
::
MARKUP_FIELD_COMMENT
);
}
}
$engine
->
process
();
$timeline
=
id
(
new
PhabricatorApplicationTransactionView
())
->
setUser
(
$viewer
)
->
setObjectPHID
(
$answer
->
getPHID
())
->
setTransactions
(
$xactions
)
->
setMarkupEngine
(
$engine
);
$qid
=
$answer
->
getQuestion
()->
getID
();
$aid
=
$answer
->
getID
();
$crumbs
=
$this
->
buildApplicationCrumbs
();
$crumbs
->
addCrumb
(
id
(
new
PhabricatorCrumbView
())
->
setName
(
"Q{$qid}"
)
->
setHref
(
"/Q{$qid}"
));
$crumbs
->
addCrumb
(
id
(
new
PhabricatorCrumbView
())
->
setName
(
"A{$aid}"
)
->
setHref
(
"/Q{$qid}#{$aid}"
));
$crumbs
->
addCrumb
(
id
(
new
PhabricatorCrumbView
())
->
setName
(
pht
(
'History'
)));
return
$this
->
buildApplicationPage
(
array
(
$crumbs
,
$timeline
,
),
array
(
'title'
=>
pht
(
'Answer History'
),
'device'
=>
true
,
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Sep 16, 5:39 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
443570
Default Alt Text
PonderAnswerHistoryController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment