Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / packages / view / PhabricatorPackagesPackageListView.php
blob78022bde385152a7112c903b4b0b6566402a589e
1 <?php
3 final class PhabricatorPackagesPackageListView
4 extends PhabricatorPackagesView {
6 private $packages;
8 public function setPackages(array $packages) {
9 assert_instances_of($packages, 'PhabricatorPackagesPackage');
10 $this->packages = $packages;
11 return $this;
14 public function getPackages() {
15 return $this->packages;
18 public function render() {
19 return $this->newListView();
22 public function newListView() {
23 $viewer = $this->getViewer();
24 $packages = $this->getPackages();
26 $list = id(new PHUIObjectItemListView())
27 ->setViewer($viewer);
29 foreach ($packages as $package) {
30 $item = id(new PHUIObjectItemView())
31 ->setObjectName($package->getFullKey())
32 ->setHeader($package->getName())
33 ->setHref($package->getURI());
35 $list->addItem($item);
38 return $list;