mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-28 09:42:41 +01:00
d179d0150c
Summary: Ref T10967. There have been two different ways to load reviewers for a while: `needReviewerStatus()` and `needRelationships()`. The `needRelationships()` stuff was a false start along time ago that didn't really go anywhere. I believe the idea was that we might want to load several different types of edges (subscribers, reviewers, etc) on lots of different types of objects. However, all that stuff pretty much ended up modularizing so that main `Query` classes did not need to know about it, so `needRelationships()` never got generalized or went anywhere. A handful of things still use it, but get rid of them: they should either `needReviewerStatus()` to get reviewer info, or the ~3 callsites that care about subscribers can just load them directly. Test Plan: - Grepped for removed methods (`needRelationships()`, `getReviewers()`, `getCCPHIDs()`, etc). - Browsed Diffusion, Differential. - Called `differential.query`. It's possible I missed some stuff, but it should mostly show up as super obvious fatals ("call needReviewerStatus() before getReviewerStatus()!"). Reviewers: chad Reviewed By: chad Maniphest Tasks: T10967 Differential Revision: https://secure.phabricator.com/D17518
34 lines
766 B
PHP
34 lines
766 B
PHP
<?php
|
|
|
|
final class DiffusionPreCommitContentRevisionReviewersHeraldField
|
|
extends DiffusionPreCommitContentHeraldField {
|
|
|
|
const FIELDCONST = 'diffusion.pre.content.revision.reviewers';
|
|
|
|
public function getHeraldFieldName() {
|
|
return pht('Differential reviewers');
|
|
}
|
|
|
|
public function getFieldGroupKey() {
|
|
return HeraldRelatedFieldGroup::FIELDGROUPKEY;
|
|
}
|
|
|
|
public function getHeraldFieldValue($object) {
|
|
$revision = $this->getAdapter()->getRevision();
|
|
|
|
if (!$revision) {
|
|
return array();
|
|
}
|
|
|
|
return $revision->getReviewerPHIDs();
|
|
}
|
|
|
|
protected function getHeraldFieldStandardType() {
|
|
return self::STANDARD_PHID_LIST;
|
|
}
|
|
|
|
protected function getDatasource() {
|
|
return new PhabricatorProjectOrUserDatasource();
|
|
}
|
|
|
|
}
|