mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-26 14:38:19 +01:00
59c294457f
Summary: Ref T8726. Continue making Herald fields more modular than they currently are. Test Plan: - Created a rule using all the affected fields. - Ran the rule. - Saw reasonable object field values. Reviewers: btrahan Reviewed By: btrahan Subscribers: eadler, joshuaspence, epriestley Maniphest Tasks: T8726 Differential Revision: https://secure.phabricator.com/D13495
35 lines
861 B
PHP
35 lines
861 B
PHP
<?php
|
|
|
|
final class HeraldProjectsField extends HeraldField {
|
|
|
|
const FIELDCONST = 'projects';
|
|
|
|
public function getHeraldFieldName() {
|
|
return pht('Projects');
|
|
}
|
|
|
|
public function supportsObject($object) {
|
|
return ($object instanceof PhabricatorProjectInterface);
|
|
}
|
|
|
|
public function getHeraldFieldValue($object) {
|
|
return PhabricatorEdgeQuery::loadDestinationPHIDs(
|
|
$object->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;
|
|
}
|
|
}
|
|
|
|
}
|