Add comparison function to MDUserRole
This commit is contained in:
@@ -191,6 +191,18 @@ enum MDUserRole implements MDValueEnumInterface, JsonSerializable {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares the user roles.
|
||||
*
|
||||
* @param MDUserRole $compareWith User role to compare with.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function isLowerThan(MDUserRole $compareWith):bool {
|
||||
if ($this->toInt() > $compareWith->toInt()) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the option to serialize as a string during json_encode().
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user