From 397d67ff3d083c4a18517f53c663d8b6f84f1927 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 15 Jun 2014 12:14:46 -0700 Subject: [PATCH] Support "Projects" field for pholio mocks in Herald Summary: Mocks can have projects now; allow Herald rules to be written against them. Test Plan: Wrote a Herald mock rule about projects. Reviewers: chad Reviewed By: chad Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D9552 --- src/__phutil_library_map__.php | 2 ++ .../herald/adapter/HeraldPholioMockAdapter.php | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 93b2bc9d19..39284871e4 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -4864,6 +4864,7 @@ phutil_register_library_map(array( array( 0 => 'PhabricatorRepositoryDAO', 1 => 'PhabricatorPolicyInterface', + 2 => 'PhabricatorDestructableInterface', ), 'PhabricatorRepositoryArcanistProjectDeleteController' => 'PhabricatorRepositoryController', 'PhabricatorRepositoryArcanistProjectEditController' => 'PhabricatorRepositoryController', @@ -5329,6 +5330,7 @@ phutil_register_library_map(array( 5 => 'PhabricatorFlaggableInterface', 6 => 'PhabricatorApplicationTransactionInterface', 7 => 'PhabricatorProjectInterface', + 8 => 'PhabricatorDestructableInterface', ), 'PholioMockCommentController' => 'PholioController', 'PholioMockEditController' => 'PholioController', diff --git a/src/applications/herald/adapter/HeraldPholioMockAdapter.php b/src/applications/herald/adapter/HeraldPholioMockAdapter.php index a49eb98387..015e162e5d 100644 --- a/src/applications/herald/adapter/HeraldPholioMockAdapter.php +++ b/src/applications/herald/adapter/HeraldPholioMockAdapter.php @@ -1,8 +1,5 @@ getMock()->getAuthorPHID(); case self::FIELD_CC: return PhabricatorSubscribersQuery::loadSubscribersForPHID( - $this->getMock()->getPHID()); + $this->getMock()->getPHID()); + case self::FIELD_PROJECTS: + return PhabricatorEdgeQuery::loadDestinationPHIDs( + $this->getMock()->getPHID(), + PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT); } return parent::getHeraldField($field);