mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-15 19:32:40 +01:00
c013108675
Summary: Ref T8726. This deals with all the Differential diff fields, same deal as previous changes. Test Plan: - Wrote a rule with every field. - Migrated it. - Saw the same rule working. - Rigged the hell out of transcripts (diffs normally do not generate transcripts, because the only action is "block" and they don't exist yet when Herald runs). - Verified that all fields looked sensible in the transcript. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T8726 Differential Revision: https://secure.phabricator.com/D13590
37 lines
949 B
PHP
37 lines
949 B
PHP
<?php
|
|
|
|
final class DifferentialDiffRepositoryProjectsHeraldField
|
|
extends DifferentialDiffHeraldField {
|
|
|
|
const FIELDCONST = 'differential.diff.repository.projects';
|
|
|
|
public function getHeraldFieldName() {
|
|
return pht('Repository projects');
|
|
}
|
|
|
|
public function getHeraldFieldValue($object) {
|
|
$repository = $this->getAdapter()->loadRepository();
|
|
if (!$repository) {
|
|
return array();
|
|
}
|
|
|
|
return PhabricatorEdgeQuery::loadDestinationPHIDs(
|
|
$repository->getPHID(),
|
|
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
|
|
}
|
|
|
|
protected function getHeraldFieldStandardConditions() {
|
|
return self::STANDARD_LIST;
|
|
}
|
|
|
|
public function getHeraldFieldValueType($condition) {
|
|
switch ($condition) {
|
|
case HeraldAdapter::CONDITION_EXISTS:
|
|
case HeraldAdapter::CONDITION_NOT_EXISTS:
|
|
return HeraldAdapter::VALUE_NONE;
|
|
default:
|
|
return HeraldAdapter::VALUE_PROJECT;
|
|
}
|
|
}
|
|
|
|
}
|