/** * Overrides OAuth2::unsetRefreshToken(). */ protected function unsetRefreshToken($refresh_token) { $token = new API_OAuth2_RefreshToken($this->app, $refresh_token); $token->delete(); return $this; }
public function testGet_value() { $this->assertEquals($this->token, $this->object->get_value()); }
/** * * @return void */ public function delete() { $this->get_token()->delete(); foreach (API_OAuth2_AuthCode::load_codes_by_account($this->app, $this) as $code) { $code->delete(); } foreach (API_OAuth2_RefreshToken::load_by_account($this->app, $this) as $token) { $token->delete(); } $sql = 'DELETE FROM api_accounts WHERE api_account_id = :account_id'; $stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt->execute(['account_id' => $this->id]); $stmt->closeCursor(); return; }