Internalize storage access for PhabricatorUserOAuthInfo

Summary:
Ref T1536. Move all access to the underlying storage to inside the class. My plan is:

  - Migrate the table to ExternalAccount.
  - Nuke the table.
  - Make this class read from and write to ExternalAccount instead.

We can't get rid of OAuthInfo completely because Facebook still depends on it for now, via registration hooks.

Test Plan: Logged in and registered with OAuth.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1536

Differential Revision: https://secure.phabricator.com/D6171
This commit is contained in:
epriestley
2013-06-14 07:00:29 -07:00
parent 3005811b9e
commit bce4b7addf
5 changed files with 38 additions and 34 deletions

View File

@@ -64,9 +64,7 @@ final class PhabricatorPeopleProfileController
// NOTE: applications install the various links through PhabricatorEvent
// listeners
$oauths = id(new PhabricatorUserOAuthInfo())->loadAllWhere(
'userID = %d',
$user->getID());
$oauths = PhabricatorUserOAuthInfo::loadAllOAuthProvidersByUser($user);
$oauths = mpull($oauths, null, 'getOAuthProvider');
$providers = PhabricatorOAuthProvider::getAllProviders();