Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/diffusion/herald/DiffusionCommitBranchesHeraldField.php
12242 views
1
<?php
2
3
final class DiffusionCommitBranchesHeraldField
4
extends DiffusionCommitHeraldField {
5
6
const FIELDCONST = 'diffusion.commit.branches';
7
8
public function getHeraldFieldName() {
9
return pht('Branches');
10
}
11
12
public function getHeraldFieldValue($object) {
13
$viewer = $this->getAdapter()->getViewer();
14
15
$commit = $object;
16
$repository = $object->getRepository();
17
18
$params = array(
19
'repository' => $repository->getPHID(),
20
'contains' => $commit->getCommitIdentifier(),
21
);
22
23
$result = id(new ConduitCall('diffusion.branchquery', $params))
24
->setUser($viewer)
25
->execute();
26
27
$refs = DiffusionRepositoryRef::loadAllFromDictionaries($result);
28
29
return mpull($refs, 'getShortName');
30
}
31
32
protected function getHeraldFieldStandardType() {
33
return self::STANDARD_TEXT_LIST;
34
}
35
36
}
37
38