Differential D14001 Diff 33843 src/applications/releeph/controller/request/ReleephRequestViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/releeph/controller/request/ReleephRequestViewController.php
<?php | <?php | ||||
final class ReleephRequestViewController | final class ReleephRequestViewController | ||||
extends ReleephBranchController { | extends ReleephBranchController { | ||||
private $requestID; | public function handleRequest(AphrontRequest $request) { | ||||
$id = $request->getURIData('requestID'); | |||||
public function willProcessRequest(array $data) { | $viewer = $request->getViewer(); | ||||
$this->requestID = $data['requestID']; | |||||
} | |||||
public function processRequest() { | |||||
$request = $this->getRequest(); | |||||
$viewer = $request->getUser(); | |||||
$pull = id(new ReleephRequestQuery()) | $pull = id(new ReleephRequestQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withIDs(array($this->requestID)) | ->withIDs(array($id)) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$pull) { | if (!$pull) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
$this->setBranch($pull->getBranch()); | $this->setBranch($pull->getBranch()); | ||||
// Redirect older URIs to new "Y" URIs. | // Redirect older URIs to new "Y" URIs. | ||||
// TODO: Get rid of this eventually. | // TODO: Get rid of this eventually. | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | return $this->buildStandardPageResponse( | ||||
array( | array( | ||||
$crumbs, | $crumbs, | ||||
$pull_box, | $pull_box, | ||||
$timeline, | $timeline, | ||||
$add_comment_form, | $add_comment_form, | ||||
), | ), | ||||
array( | array( | ||||
'title' => $title, | 'title' => $title, | ||||
'device' => true, | |||||
)); | )); | ||||
} | } | ||||
} | } |