From d193e9ba794ce15e4037f8c4c644ac95375bbecb Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Thu, 19 Dec 2024 02:40:25 +0000 Subject: [PATCH] add ResourceType for filtering later --- src/Entity/CommunityResource.php | 19 +++++++++++++++++++ src/Enums/ResourceType.php | 12 ++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 src/Enums/ResourceType.php diff --git a/src/Entity/CommunityResource.php b/src/Entity/CommunityResource.php index 8533d65..9241f11 100644 --- a/src/Entity/CommunityResource.php +++ b/src/Entity/CommunityResource.php @@ -3,6 +3,7 @@ namespace App\Entity; use App\Enums\County; +use App\Enums\ResourceType; use App\Enums\State; use App\Repository\CommunityResourceRepository; use DateTime; @@ -99,6 +100,9 @@ class CommunityResource #[ORM\Column(length: 255, nullable: true)] private ?string $servicesAvailable = null; + #[ORM\Column(type: Types::SIMPLE_ARRAY, enumType: ResourceType::class)] + private array $type = []; + public function __construct( private DateTime $today ) { @@ -623,4 +627,19 @@ class CommunityResource return $this; } + + /** + * @return ResourceType[] + */ + public function getType(): array + { + return $this->type; + } + + public function setType(array $type): static + { + $this->type = $type; + + return $this; + } } diff --git a/src/Enums/ResourceType.php b/src/Enums/ResourceType.php new file mode 100644 index 0000000..13832db --- /dev/null +++ b/src/Enums/ResourceType.php @@ -0,0 +1,12 @@ +