@@ 87-104 (lines=18) @@ | ||
84 | return $stmt->fetch(PDO::FETCH_ASSOC); |
|
85 | } |
|
86 | ||
87 | public function get($accessTokenKey) |
|
88 | { |
|
89 | $stmt = $this->db->prepare( |
|
90 | 'SELECT |
|
91 | user_id, |
|
92 | access_token, |
|
93 | client_id, |
|
94 | scope, |
|
95 | expires_at |
|
96 | FROM tokens |
|
97 | WHERE |
|
98 | access_token_key = :access_token_key' |
|
99 | ); |
|
100 | ||
101 | $stmt->bindValue(':access_token_key', $accessTokenKey, PDO::PARAM_STR); |
|
102 | $stmt->execute(); |
|
103 | ||
104 | return $stmt->fetch(PDO::FETCH_ASSOC); |
|
105 | } |
|
106 | ||
107 | public function getAuthorizedClients($userId) |
|
@@ 107-122 (lines=16) @@ | ||
104 | return $stmt->fetch(PDO::FETCH_ASSOC); |
|
105 | } |
|
106 | ||
107 | public function getAuthorizedClients($userId) |
|
108 | { |
|
109 | $stmt = $this->db->prepare( |
|
110 | 'SELECT |
|
111 | client_id, |
|
112 | scope |
|
113 | FROM tokens |
|
114 | WHERE |
|
115 | user_id = :user_id' |
|
116 | ); |
|
117 | ||
118 | $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR); |
|
119 | $stmt->execute(); |
|
120 | ||
121 | return $stmt->fetchAll(PDO::FETCH_ASSOC); |
|
122 | } |
|
123 | ||
124 | public function removeClientTokens($userId, $clientId) |
|
125 | { |