Page MenuHomec4science

PholioMockListController.php
No OneTemporary

File Metadata

Created
Wed, Jan 8, 23:53

PholioMockListController.php

<?php
/**
* @group pholio
*/
final class PholioMockListController extends PholioController {
private $view;
public function willProcessRequest(array $data) {
$this->view = idx($data, 'view');
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$query = id(new PholioMockQuery())
->setViewer($user);
$nav = $this->buildSideNav();
$filter = $nav->selectFilter('view/'.$this->view, 'view/all');
switch ($filter) {
case 'view/all':
default:
$title = 'All Mocks';
break;
}
$pager = new AphrontCursorPagerView();
$pager->readFromRequest($request);
$mocks = $query->executeWithCursorPager($pager);
$board = new PhabricatorPinboardView();
foreach ($mocks as $mock) {
$board->addItem(
id(new PhabricatorPinboardItemView())
->setHeader($mock->getName())
->setURI('/M'.$mock->getID()));
}
$header = id(new PhabricatorHeaderView())
->setHeader($title);
$content = array(
$header,
$board,
$pager,
);
$nav->appendChild($content);
return $this->buildApplicationPage(
$nav,
array(
'title' => $title,
));
}
}

Event Timeline