Differential D20955 Diff 49930 src/applications/diffusion/herald/DiffusionCommitCommitterProjectsHeraldField.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/herald/DiffusionCommitCommitterProjectsHeraldField.php
| <?php | <?php | ||||
| final class DiffusionCommitCommitterProjectsHeraldField | final class DiffusionCommitCommitterProjectsHeraldField | ||||
| extends DiffusionCommitHeraldField { | extends DiffusionCommitHeraldField { | ||||
| const FIELDCONST = 'diffusion.commit.committer.projects'; | const FIELDCONST = 'diffusion.commit.committer.projects'; | ||||
| public function getHeraldFieldName() { | public function getHeraldFieldName() { | ||||
| return pht("Committer's projects"); | return pht("Committer's projects"); | ||||
| } | } | ||||
| public function getHeraldFieldValue($object) { | public function getHeraldFieldValue($object) { | ||||
| $adapter = $this->getAdapter(); | $adapter = $this->getAdapter(); | ||||
| $viewer = $adapter->getViewer(); | |||||
| $phid = $object->getCommitData()->getCommitDetail('committerPHID'); | $phid = $adapter->getCommitterPHID(); | ||||
| if (!$phid) { | if (!$phid) { | ||||
| return array(); | return array(); | ||||
| } | } | ||||
| $viewer = $adapter->getViewer(); | $viewer = $adapter->getViewer(); | ||||
| $projects = id(new PhabricatorProjectQuery()) | $projects = id(new PhabricatorProjectQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| Show All 15 Lines | |||||