From acc266739d1e0e51c814c6a9d7450fbeed61d257 Mon Sep 17 00:00:00 2001 From: thibaud-leclere Date: Wed, 1 Apr 2026 14:22:33 +0200 Subject: [PATCH] feat: add AwardType entity and repository --- src/Entity/AwardType.php | 69 ++++++++++++++++++++++++++ src/Repository/AwardTypeRepository.php | 24 +++++++++ 2 files changed, 93 insertions(+) create mode 100644 src/Entity/AwardType.php create mode 100644 src/Repository/AwardTypeRepository.php diff --git a/src/Entity/AwardType.php b/src/Entity/AwardType.php new file mode 100644 index 0000000..885beab --- /dev/null +++ b/src/Entity/AwardType.php @@ -0,0 +1,69 @@ + */ + #[ORM\OneToMany(targetEntity: Award::class, mappedBy: 'awardType')] + private Collection $awards; + + public function __construct() + { + $this->awards = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getName(): string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getPattern(): string + { + return $this->pattern; + } + + public function setPattern(string $pattern): static + { + $this->pattern = $pattern; + + return $this; + } + + /** @return Collection */ + public function getAwards(): Collection + { + return $this->awards; + } +} diff --git a/src/Repository/AwardTypeRepository.php b/src/Repository/AwardTypeRepository.php new file mode 100644 index 0000000..f5beb63 --- /dev/null +++ b/src/Repository/AwardTypeRepository.php @@ -0,0 +1,24 @@ + */ +class AwardTypeRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, AwardType::class); + } + + /** @return list */ + public function findAll(): array + { + return parent::findAll(); + } +}