Add method to check levels

This commit is contained in:
Ryan Prather 2024-12-10 22:50:20 -05:00
parent 6454d3db47
commit 30f9be37ec

View File

@ -2,6 +2,7 @@
namespace App\Entity; namespace App\Entity;
use App\Enums\CaseLevel;
use App\Repository\UserCaseRepository; use App\Repository\UserCaseRepository;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
@ -49,4 +50,9 @@ class UserCase
return $this; return $this;
} }
public static function checkLevel(User $user, MemberCase $case): bool
{
return ($user->getLevel()->value >= $case->getLevel()->value);
}
} }