+ /**
+ * @var \OCP\IDBConnection
+ */
+ protected $db;
+
+ public function __construct($urlGen)
+ {
+ $this->db = \OC::$server->getDatabaseConnection();
+ }
+
+ /**
+ * Delete token
+ *
+ * @param string $type Token type: temp, access, verify
+ * @param string $tokenKey Random token string to load
+ *
+ * @return void
+ *
+ * @throws OAuthException When token does not exist
+ */
+ public function delete($type, $tokenKey)
+ {
+ $this->db->executeQuery(
+ 'DELETE FROM `*PREFIX*grauphel_oauth_tokens`'
+ . ' WHERE `token_key` = ? AND `token_type` = ?',
+ array($tokenKey, $type)
+ );
+ }
+