Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / diffusion / herald / DiffusionPreCommitContentRevisionAcceptedHeraldField.php
blob63dac6baa6a47d3eecf287d2c19136209f8ae2e7
1 <?php
3 final class DiffusionPreCommitContentRevisionAcceptedHeraldField
4 extends DiffusionPreCommitContentHeraldField {
6 const FIELDCONST = 'diffusion.pre.content.revision.accepted';
8 public function getHeraldFieldName() {
9 return pht('Accepted Differential revision');
12 public function getFieldGroupKey() {
13 return HeraldRelatedFieldGroup::FIELDGROUPKEY;
16 public function getHeraldFieldValue($object) {
17 $revision = $this->getAdapter()->getRevision();
18 if (!$revision) {
19 return null;
22 if ($revision->isAccepted()) {
23 return $revision->getPHID();
26 $was_accepted = DifferentialRevision::PROPERTY_CLOSED_FROM_ACCEPTED;
27 if ($revision->isPublished()) {
28 if ($revision->getProperty($was_accepted)) {
29 return $revision->getPHID();
33 return null;
36 protected function getHeraldFieldStandardType() {
37 return self::STANDARD_PHID_BOOL;