From 30f9be37ec9031a7daf09f9a05441062e29d96a9 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Tue, 10 Dec 2024 22:50:20 -0500 Subject: [PATCH] Add method to check levels --- src/Entity/UserCase.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Entity/UserCase.php b/src/Entity/UserCase.php index fca3f60..d7580a5 100644 --- a/src/Entity/UserCase.php +++ b/src/Entity/UserCase.php @@ -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); + } }