Skip to content

Commit

Permalink
Merge pull request #100 from mohitmamoria/master
Browse files Browse the repository at this point in the history
Converting PDO results into objects
  • Loading branch information
lucadegasperi committed May 30, 2014
2 parents c87fc6b + a90ac34 commit abd252c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/LucaDegasperi/OAuth2Server/Repositories/FluentClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public function getClient($clientId, $clientSecret = null, $redirectUri = null,
return false;
}

$result = (object) $result;

$metadata = DB::table('oauth_client_metadata')->where('client_id', '=', $result->id)->lists('value', 'key');

return array(
Expand Down
2 changes: 2 additions & 0 deletions src/LucaDegasperi/OAuth2Server/Repositories/FluentScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public function getScope($scope, $clientId = null, $grantType = null)
return false;
}

$result = (object) $result;

return array(
'id' => $result->id,
'scope' => $result->scope,
Expand Down
3 changes: 3 additions & 0 deletions src/LucaDegasperi/OAuth2Server/Repositories/FluentSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ public function getScopes($accessToken)

foreach($scopeResults as $key=>$scope)
{
$scope = (object) $scope;
$scopes[$key] = get_object_vars($scope);

}
Expand Down Expand Up @@ -452,6 +453,7 @@ public function getAuthCodeScopes($oauthSessionAuthCodeId)

foreach($scopesResults as $key=>$scope)
{
$scope = (object) $scope;
$scopes[$key] = get_object_vars($scope);

}
Expand Down Expand Up @@ -497,6 +499,7 @@ public function deleteExpired()
return 0;
} else {
foreach ($expiredSessions as $session) {
$session = (object) $session;
DB::table('oauth_sessions')
->where('id', '=', $session->session_id)
->delete();
Expand Down

0 comments on commit abd252c

Please sign in to comment.