1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +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->openTransaction();
$this->delete(); $this->delete();
$externals = id(new PhabricatorExternalAccount())->loadAllWhere( $externals = id(new PhabricatorExternalAccountQuery())
'userPHID = %s', ->setViewer($engine->getViewer())
$this->getPHID()); ->withUserPHIDs(array($this->getPHID()))
->execute();
foreach ($externals as $external) { foreach ($externals as $external) {
$external->delete(); $external->delete();
} }