add ResourceType for filtering later

This commit is contained in:
Ryan Prather 2024-12-19 02:40:25 +00:00
parent d7bddc0328
commit d193e9ba79
2 changed files with 31 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Enums;
enum ResourceType: int
{
case FOOD_PANTRY = 0;
case CLOTHES_CLOSET = 1;
case JOB_OPENINGS = 2;
case HOUSING = 3;
case PARENT_SUPPORT = 4;
}