revokeAll() implementation for DbManager

This commit is contained in:
Panagiotis Moustafellos
2013-11-23 18:36:19 +02:00
parent 8eb3b53f2a
commit 234feabaac

View File

@@ -276,6 +276,18 @@ class DbManager extends Manager
->execute() > 0; ->execute() > 0;
} }
/**
* Revokes all authorization assignments from a user.
* @param mixed $userId the user ID (see [[User::id]])
* @return boolean whether removal is successful
*/
public function revokeAll($userId)
{
return $this->db->createCommand()
->delete($this->assignmentTable, ['user_id' => $userId])
->execute() > 0;
}
/** /**
* Returns a value indicating whether the item has been assigned to the user. * Returns a value indicating whether the item has been assigned to the user.
* @param mixed $userId the user ID (see [[User::id]]) * @param mixed $userId the user ID (see [[User::id]])