Add user repository as a service

This commit is contained in:
Romain Neutron
2014-02-27 17:02:29 +01:00
parent ed8f98432d
commit 8f87e8b1c8
53 changed files with 127 additions and 123 deletions

View File

@@ -84,7 +84,7 @@ class API_OAuth2_Account
$stmt->closeCursor();
$this->application_id = (int) $row['application_id'];
$this->user = $app['manipulator.user']->getRepository()->find($row['usr_id']);
$this->user = $app['repo.users']->find($row['usr_id']);
$this->api_version = $row['api_version'];
$this->revoked = ! ! $row['revoked'];

View File

@@ -521,7 +521,7 @@ class API_OAuth2_Adapter extends OAuth2
*/
private function createAccount($usr_id)
{
$user = $this->app['manipulator.user']->getRepository()->find($usr_id);
$user = $this->app['repo.users']->find($usr_id);
return API_OAuth2_Account::create($this->app, $user, $this->client);
}
@@ -794,7 +794,7 @@ class API_OAuth2_Adapter extends OAuth2
return false;
}
if (null === $user = $this->app['manipulator.user']->getRepository()->find($usr_id)) {
if (null === $user = $this->app['repo.users']->find($usr_id)) {
return false;
}

View File

@@ -146,7 +146,7 @@ class API_OAuth2_Application
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor();
$this->creator = ! $row['creator'] ? null : $this->app['manipulator.user']->getRepository()->find($row['creator']);
$this->creator = ! $row['creator'] ? null : $this->app['repo.users']->find($row['creator']);
$this->type = $row['type'];
$this->name = $row['name'];
$this->description = $row['description'];