1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00

Convert a manual query against external accounts into a modern Query

Summary: Depends on D20108. Ref T6703. Update this outdated callsite to a more modern appraoch.

Test Plan: Destroyed a user with `bin/remove destroy`.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T6703

Differential Revision: https://secure.phabricator.com/D20109
This commit is contained in:
epriestley 2019-02-06 12:45:02 -08:00
parent f0364eef8a
commit 8054f7d191

View file

@ -1131,9 +1131,10 @@ final class PhabricatorUser
$this->openTransaction();
$this->delete();
$externals = id(new PhabricatorExternalAccount())->loadAllWhere(
'userPHID = %s',
$this->getPHID());
$externals = id(new PhabricatorExternalAccountQuery())
->setViewer($engine->getViewer())
->withUserPHIDs(array($this->getPHID()))
->execute();
foreach ($externals as $external) {
$external->delete();
}