Add comparison function to MDUserRole
This commit is contained in:
1 file changed
+12
@@ -191,6 +191,18 @@ public function getTledName(MDTlLoader $tlLoader):string {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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