Differential D14001 Diff 33860 src/applications/releeph/controller/product/ReleephProductViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/releeph/controller/product/ReleephProductViewController.php
<?php | <?php | ||||
final class ReleephProductViewController extends ReleephProductController { | final class ReleephProductViewController extends ReleephProductController { | ||||
private $productID; | |||||
private $queryKey; | |||||
public function shouldAllowPublic() { | public function shouldAllowPublic() { | ||||
return true; | return true; | ||||
} | } | ||||
public function willProcessRequest(array $data) { | public function handleRequest(AphrontRequest $request) { | ||||
$this->productID = idx($data, 'projectID'); | $id = $request->getURIData('projectID'); | ||||
$this->queryKey = idx($data, 'queryKey'); | $query_key = $request->getURIData('queryKey'); | ||||
} | $viewer = $request->getViewer(); | ||||
public function processRequest() { | |||||
$request = $this->getRequest(); | |||||
$viewer = $request->getUser(); | |||||
$product = id(new ReleephProductQuery()) | $product = id(new ReleephProductQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withIDs(array($this->productID)) | ->withIDs(array($id)) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$product) { | if (!$product) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
$this->setProduct($product); | $this->setProduct($product); | ||||
$controller = id(new PhabricatorApplicationSearchController()) | $controller = id(new PhabricatorApplicationSearchController()) | ||||
->setQueryKey($this->queryKey) | ->setQueryKey($query_key) | ||||
->setPreface($this->renderPreface()) | ->setPreface($this->renderPreface()) | ||||
->setSearchEngine( | ->setSearchEngine( | ||||
id(new ReleephBranchSearchEngine()) | id(new ReleephBranchSearchEngine()) | ||||
->setProduct($product)) | ->setProduct($product)) | ||||
->setNavigation($this->buildSideNavView()); | ->setNavigation($this->buildSideNavView()); | ||||
return $this->delegateToController($controller); | return $this->delegateToController($controller); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines |