3 abstract class DifferentialRevisionResultBucket
4 extends PhabricatorSearchResultBucket
{
6 public static function getAllResultBuckets() {
7 return id(new PhutilClassMapQuery())
8 ->setAncestorClass(__CLASS__
)
9 ->setUniqueMethod('getResultBucketKey')
13 protected function getRevisionsUnderReview(array $objects, array $phids) {
16 $objects = $this->getRevisionsNotAuthored($objects, $phids);
18 foreach ($objects as $key => $object) {
19 if (!$object->isNeedsReview()) {
23 $results[$key] = $object;
29 protected function getRevisionsAuthored(array $objects, array $phids) {
32 foreach ($objects as $key => $object) {
33 if (isset($phids[$object->getAuthorPHID()])) {
34 $results[$key] = $object;
41 protected function getRevisionsNotAuthored(array $objects, array $phids) {
44 foreach ($objects as $key => $object) {
45 if (empty($phids[$object->getAuthorPHID()])) {
46 $results[$key] = $object;
53 protected function hasReviewersWithStatus(
54 DifferentialRevision
$revision,
57 $include_voided = null) {
59 foreach ($revision->getReviewers() as $reviewer) {
60 $reviewer_phid = $reviewer->getReviewerPHID();
61 if (empty($phids[$reviewer_phid])) {
65 $status = $reviewer->getReviewerStatus();
66 if (empty($statuses[$status])) {
70 if ($include_voided !== null) {
71 if ($status == DifferentialReviewerStatus
::STATUS_ACCEPTED
) {
72 $is_voided = (bool)$reviewer->getVoidedPHID();
73 if ($is_voided !== $include_voided) {