Add method to check levels
This commit is contained in:
parent
6454d3db47
commit
30f9be37ec
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Enums\CaseLevel;
|
||||
use App\Repository\UserCaseRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
@ -49,4 +50,9 @@ class UserCase
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public static function checkLevel(User $user, MemberCase $case): bool
|
||||
{
|
||||
return ($user->getLevel()->value >= $case->getLevel()->value);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user