Add method to clear all keys associated with the user

This is needed when changing modules, we need to remove all keys
from the old module

Change-Id: Iaada3df631260dbd612cce01f5477e93e6da4596
This commit is contained in:
Dejan Savuljesku 2019-08-22 09:37:46 +02:00 committed by Reedy
parent 275a5a54cc
commit 019cf6ccdd

View file

@ -110,6 +110,20 @@ class OATHUser {
}
}
/**
* Removes all keys associated with the user
* Warning: This only removes the keys in memory,
* changes need to be persisted
*/
public function clearAllKeys() {
$this->keys = [];
}
/**
* Adds single key to the key array
*
* @param IAuthKey $key
*/
public function addKey( IAuthKey $key ) {
if ( !$this->keyTypeCorrect( $key ) ) {
return;