3 final class DiffusionRepositoryIdentityDestructionEngineExtension
4 extends PhabricatorDestructionEngineExtension
{
6 const EXTENSIONKEY
= 'repository-identities';
8 public function getExtensionName() {
9 return pht('Repository Identities');
12 public function didDestroyObject(
13 PhabricatorDestructionEngine
$engine,
16 // When users or email addresses are destroyed, queue a task to update
17 // any repository identities that are associated with them. See T13444.
19 $related_phids = array();
20 $email_addresses = array();
22 if ($object instanceof PhabricatorUser
) {
23 $related_phids[] = $object->getPHID();
26 if ($object instanceof PhabricatorUserEmail
) {
27 $email_addresses[] = $object->getAddress();
30 if ($related_phids ||
$email_addresses) {
31 PhabricatorWorker
::scheduleTask(
32 'PhabricatorRepositoryIdentityChangeWorker',
34 'relatedPHIDs' => $related_phids,
35 'emailAddresses' => $email_addresses,