Remove product literal strings in "pht()", part 6
[phabricator.git] / src / applications / harbormaster / conduit / HarbormasterQueryBuildablesConduitAPIMethod.php
blobcae06d47c7054ed91e64d40f44a2115ddd549631
1 <?php
3 final class HarbormasterQueryBuildablesConduitAPIMethod
4 extends HarbormasterConduitAPIMethod {
6 public function getAPIMethodName() {
7 return 'harbormaster.querybuildables';
10 public function getMethodDescription() {
11 return pht('Query Harbormaster buildables.');
14 protected function defineParamTypes() {
15 return array(
16 'ids' => 'optional list<id>',
17 'phids' => 'optional list<phid>',
18 'buildablePHIDs' => 'optional list<phid>',
19 'containerPHIDs' => 'optional list<phid>',
20 'manualBuildables' => 'optional bool',
21 ) + self::getPagerParamTypes();
24 protected function defineReturnType() {
25 return 'wild';
28 protected function execute(ConduitAPIRequest $request) {
29 $viewer = $request->getUser();
31 $query = id(new HarbormasterBuildableQuery())
32 ->setViewer($viewer);
34 $ids = $request->getValue('ids');
35 if ($ids !== null) {
36 $query->withIDs($ids);
39 $phids = $request->getValue('phids');
40 if ($phids !== null) {
41 $query->withPHIDs($phids);
44 $buildable_phids = $request->getValue('buildablePHIDs');
45 if ($buildable_phids !== null) {
46 $query->withBuildablePHIDs($buildable_phids);
49 $container_phids = $request->getValue('containerPHIDs');
50 if ($container_phids !== null) {
51 $query->withContainerPHIDs($container_phids);
54 $manual = $request->getValue('manualBuildables');
55 if ($manual !== null) {
56 $query->withManualBuildables($manual);
59 $pager = $this->newPager($request);
61 $buildables = $query->executeWithCursorPager($pager);
63 $data = array();
64 foreach ($buildables as $buildable) {
65 $monogram = $buildable->getMonogram();
67 $status = $buildable->getBuildableStatus();
68 $status_name = $buildable->getStatusDisplayName();
70 $data[] = array(
71 'id' => $buildable->getID(),
72 'phid' => $buildable->getPHID(),
73 'monogram' => $monogram,
74 'uri' => PhabricatorEnv::getProductionURI('/'.$monogram),
75 'buildableStatus' => $status,
76 'buildableStatusName' => $status_name,
77 'buildablePHID' => $buildable->getBuildablePHID(),
78 'containerPHID' => $buildable->getContainerPHID(),
79 'isManualBuildable' => (bool)$buildable->getIsManualBuildable(),
83 $results = array(
84 'data' => $data,
87 $results = $this->addPagerResults($results, $pager);
88 return $results;