From c09b46bce9520fd92185c8e7119a43bdbbe06e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 23 Jun 2026 08:17:56 +0200 Subject: [PATCH] wip: implement model --- .env | 4 + config/services.yaml | 4 + migrations/Version20260625092525.php | 59 +++++ src/Entity/BlameableEntity.php | 40 ++++ src/Entity/BlameableEntityInterface.php | 14 ++ src/Entity/Groups/Accommodation.php | 217 ++++++++++++++++++ src/Entity/Groups/AccommodationPrice.php | 134 +++++++++++ src/Entity/Groups/AdditionalService.php | 150 ++++++++++++ src/Entity/Groups/BoardService.php | 119 ++++++++++ src/Entity/TimestampableEntity.php | 38 +++ src/Entity/TimestampableEntityInterface.php | 14 ++ src/Enum/Groups/AdditionalServiceType.php | 11 + src/EventListener/BlamableEntityListener.php | 41 ++++ .../TimestampableEntityListener.php | 34 +++ .../Groups/AccommodationPriceRepository.php | 43 ++++ .../Groups/AccommodationRepository.php | 43 ++++ .../Groups/AdditionalServiceRepository.php | 18 ++ .../Groups/BoardServiceRepository.php | 18 ++ 18 files changed, 1001 insertions(+) create mode 100644 migrations/Version20260625092525.php create mode 100644 src/Entity/BlameableEntity.php create mode 100644 src/Entity/BlameableEntityInterface.php create mode 100644 src/Entity/Groups/Accommodation.php create mode 100644 src/Entity/Groups/AccommodationPrice.php create mode 100644 src/Entity/Groups/AdditionalService.php create mode 100644 src/Entity/Groups/BoardService.php create mode 100644 src/Entity/TimestampableEntity.php create mode 100644 src/Entity/TimestampableEntityInterface.php create mode 100644 src/Enum/Groups/AdditionalServiceType.php create mode 100644 src/EventListener/BlamableEntityListener.php create mode 100644 src/EventListener/TimestampableEntityListener.php create mode 100644 src/Repository/Groups/AccommodationPriceRepository.php create mode 100644 src/Repository/Groups/AccommodationRepository.php create mode 100644 src/Repository/Groups/AdditionalServiceRepository.php create mode 100644 src/Repository/Groups/BoardServiceRepository.php diff --git a/.env b/.env index 4f2ec8f2..069976e4 100644 --- a/.env +++ b/.env @@ -78,6 +78,10 @@ FEATURE_TRAVEL_SNAPSHOT=true APP_DEFAULT_EMAIL_FROM=info@ep-reisen.de APP_DEFAULT_EMAIL_TO=info@ep-reisen.de +# Global common defaults +APP_SEASON_WINTER_FROM=2026-10-01 +APP_SEASON_SUMMER_FROM=2026-05-01 + # Booking Configuration # Status for new bookings: 'F' (Fixed/Final), 'O' (Option - requires agency confirmation) # Use 'O' during beta phase, switch to 'F' for production diff --git a/config/services.yaml b/config/services.yaml index 80958e52..d68f6d64 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -43,6 +43,10 @@ parameters: shoe_size_min: 35 shoe_size_max: 50 + # Season data + season_winter_from: '%env(APP_SEASON_WINTER_FROM)%' + season_summer_from: '%env(APP_SEASON_SUMMER_FROM)%' + # domain mapping for theme, gtm id and cmp url domain_config: ep-reisen.de: diff --git a/migrations/Version20260625092525.php b/migrations/Version20260625092525.php new file mode 100644 index 00000000..24bbffad --- /dev/null +++ b/migrations/Version20260625092525.php @@ -0,0 +1,59 @@ +addSql('CREATE TABLE accommodation (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(16) NOT NULL, min_pax_summer INT NOT NULL, max_adolescent_age INT NOT NULL, currency VARCHAR(3) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', UNIQUE INDEX UNIQ_2D38541277153098 (code), INDEX IDX_2D385412B03A8386 (created_by_id), INDEX IDX_2D385412896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE accommodation_price (id INT AUTO_INCREMENT NOT NULL, accommodation_id INT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, date_from DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\', date_to DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\', included_pax INT NOT NULL, price_per_night INT NOT NULL, price_additional_person INT NOT NULL, min_nights INT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_C67701238F3692CD (accommodation_id), INDEX IDX_C6770123B03A8386 (created_by_id), INDEX IDX_C6770123896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE additional_service (id INT AUTO_INCREMENT NOT NULL, accommodation_id INT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, label VARCHAR(255) NOT NULL, price INT NOT NULL, type VARCHAR(20) NOT NULL, date_from DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\', date_to DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\', `grouping` VARCHAR(128) NOT NULL, sorting INT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_E01749268F3692CD (accommodation_id), INDEX IDX_E0174926B03A8386 (created_by_id), INDEX IDX_E0174926896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE board_service (id INT AUTO_INCREMENT NOT NULL, accommodation_id INT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, label VARCHAR(255) NOT NULL, price INT NOT NULL, date_from DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\', date_to DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\', sorting INT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_A983B2DD8F3692CD (accommodation_id), INDEX IDX_A983B2DDB03A8386 (created_by_id), INDEX IDX_A983B2DD896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('ALTER TABLE accommodation ADD CONSTRAINT FK_2D385412B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE accommodation ADD CONSTRAINT FK_2D385412896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE accommodation_price ADD CONSTRAINT FK_C67701238F3692CD FOREIGN KEY (accommodation_id) REFERENCES accommodation (id)'); + $this->addSql('ALTER TABLE accommodation_price ADD CONSTRAINT FK_C6770123B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE accommodation_price ADD CONSTRAINT FK_C6770123896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE additional_service ADD CONSTRAINT FK_E01749268F3692CD FOREIGN KEY (accommodation_id) REFERENCES accommodation (id)'); + $this->addSql('ALTER TABLE additional_service ADD CONSTRAINT FK_E0174926B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE additional_service ADD CONSTRAINT FK_E0174926896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE board_service ADD CONSTRAINT FK_A983B2DD8F3692CD FOREIGN KEY (accommodation_id) REFERENCES accommodation (id)'); + $this->addSql('ALTER TABLE board_service ADD CONSTRAINT FK_A983B2DDB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE board_service ADD CONSTRAINT FK_A983B2DD896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id) ON DELETE SET NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE accommodation DROP FOREIGN KEY FK_2D385412B03A8386'); + $this->addSql('ALTER TABLE accommodation DROP FOREIGN KEY FK_2D385412896DBBDE'); + $this->addSql('ALTER TABLE accommodation_price DROP FOREIGN KEY FK_C67701238F3692CD'); + $this->addSql('ALTER TABLE accommodation_price DROP FOREIGN KEY FK_C6770123B03A8386'); + $this->addSql('ALTER TABLE accommodation_price DROP FOREIGN KEY FK_C6770123896DBBDE'); + $this->addSql('ALTER TABLE additional_service DROP FOREIGN KEY FK_E01749268F3692CD'); + $this->addSql('ALTER TABLE additional_service DROP FOREIGN KEY FK_E0174926B03A8386'); + $this->addSql('ALTER TABLE additional_service DROP FOREIGN KEY FK_E0174926896DBBDE'); + $this->addSql('ALTER TABLE board_service DROP FOREIGN KEY FK_A983B2DD8F3692CD'); + $this->addSql('ALTER TABLE board_service DROP FOREIGN KEY FK_A983B2DDB03A8386'); + $this->addSql('ALTER TABLE board_service DROP FOREIGN KEY FK_A983B2DD896DBBDE'); + $this->addSql('DROP TABLE accommodation'); + $this->addSql('DROP TABLE accommodation_price'); + $this->addSql('DROP TABLE additional_service'); + $this->addSql('DROP TABLE board_service'); + } +} diff --git a/src/Entity/BlameableEntity.php b/src/Entity/BlameableEntity.php new file mode 100644 index 00000000..ecf33205 --- /dev/null +++ b/src/Entity/BlameableEntity.php @@ -0,0 +1,40 @@ +createdBy; + } + + public function setCreatedBy(?User $createdBy): self + { + $this->createdBy = $createdBy; + + return $this; + } + + public function getUpdatedBy(): ?User + { + return $this->updatedBy; + } + + public function setUpdatedBy(?User $updatedBy): self + { + $this->updatedBy = $updatedBy; + + return $this; + } +} diff --git a/src/Entity/BlameableEntityInterface.php b/src/Entity/BlameableEntityInterface.php new file mode 100644 index 00000000..514778ab --- /dev/null +++ b/src/Entity/BlameableEntityInterface.php @@ -0,0 +1,14 @@ + + */ + #[ORM\OneToMany(targetEntity: AccommodationPrice::class, mappedBy: 'accommodation')] + private Collection $accommodationPrices; + + /** + * @var Collection + */ + #[ORM\OneToMany(targetEntity: BoardService::class, mappedBy: 'accommodation')] + private Collection $boardServices; + + /** + * @var Collection + */ + #[ORM\OneToMany(targetEntity: AdditionalService::class, mappedBy: 'accommodation')] + private Collection $additionalServices; + + #[ORM\Column] + private ?int $maxAdolescentAge = null; + + #[ORM\Column(length: 3)] + private ?string $currency = 'EUR'; + + public function __construct() + { + $this->accommodationPrices = new ArrayCollection(); + $this->boardServices = new ArrayCollection(); + $this->additionalServices = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): self + { + $this->name = $name; + + return $this; + } + + public function getCode(): ?string + { + return $this->code; + } + + public function setCode(string $code): self + { + $this->code = $code; + + return $this; + } + + public function getMinPaxSummer(): ?int + { + return $this->minPaxSummer; + } + + public function setMinPaxSummer(int $minPaxSummer): self + { + $this->minPaxSummer = $minPaxSummer; + + return $this; + } + + /** + * @return Collection + */ + public function getAccommodationPrices(): Collection + { + return $this->accommodationPrices; + } + + public function addAccommodationPrice(AccommodationPrice $accommodationPrice): self + { + if (!$this->accommodationPrices->contains($accommodationPrice)) { + $this->accommodationPrices->add($accommodationPrice); + $accommodationPrice->setAccommodation($this); + } + + return $this; + } + + public function removeAccommodationPrice(AccommodationPrice $accommodationPrice): self + { + if ($this->accommodationPrices->removeElement($accommodationPrice)) { + // set the owning side to null (unless already changed) + if ($accommodationPrice->getAccommodation() === $this) { + $accommodationPrice->setAccommodation(null); + } + } + + return $this; + } + + public function getMaxAdolescentAge(): ?int + { + return $this->maxAdolescentAge; + } + + public function setMaxAdolescentAge(int $maxAdolescentAge): self + { + $this->maxAdolescentAge = $maxAdolescentAge; + + return $this; + } + + public function getCurrency(): ?string + { + return $this->currency; + } + + public function setCurrency(string $currency): self + { + $this->currency = $currency; + + return $this; + } + + /** + * @return Collection + */ + public function getBoardServices(): Collection + { + return $this->boardServices; + } + + public function addBoardService(BoardService $boardService): self + { + if (!$this->boardServices->contains($boardService)) { + $this->boardServices->add($boardService); + $boardService->setAccommodation($this); + } + + return $this; + } + + public function removeBoardService(BoardService $boardService): self + { + if ($this->boardServices->removeElement($boardService)) { + if ($boardService->getAccommodation() === $this) { + $boardService->setAccommodation(null); + } + } + + return $this; + } + + /** + * @return Collection + */ + public function getAdditionalServices(): Collection + { + return $this->additionalServices; + } + + public function addAdditionalService(AdditionalService $additionalService): self + { + if (!$this->additionalServices->contains($additionalService)) { + $this->additionalServices->add($additionalService); + $additionalService->setAccommodation($this); + } + + return $this; + } + + public function removeAdditionalService(AdditionalService $additionalService): self + { + if ($this->additionalServices->removeElement($additionalService)) { + if ($additionalService->getAccommodation() === $this) { + $additionalService->setAccommodation(null); + } + } + + return $this; + } +} diff --git a/src/Entity/Groups/AccommodationPrice.php b/src/Entity/Groups/AccommodationPrice.php new file mode 100644 index 00000000..5e6e583b --- /dev/null +++ b/src/Entity/Groups/AccommodationPrice.php @@ -0,0 +1,134 @@ +id; + } + + public function getAccommodation(): ?Accommodation + { + return $this->accommodation; + } + + public function setAccommodation(?Accommodation $accommodation): self + { + $this->accommodation = $accommodation; + + return $this; + } + + public function getDateFrom(): ?\DateTimeImmutable + { + return $this->dateFrom; + } + + public function setDateFrom(\DateTimeImmutable $dateFrom): self + { + $this->dateFrom = $dateFrom; + + return $this; + } + + public function getDateTo(): ?\DateTimeImmutable + { + return $this->dateTo; + } + + public function setDateTo(\DateTimeImmutable $dateTo): self + { + $this->dateTo = $dateTo; + + return $this; + } + + public function getIncludedPax(): ?int + { + return $this->includedPax; + } + + public function setIncludedPax(int $includedPax): self + { + $this->includedPax = $includedPax; + + return $this; + } + + public function getPricePerNight(): ?int + { + return $this->pricePerNight; + } + + public function setPricePerNight(int $pricePerNight): self + { + $this->pricePerNight = $pricePerNight; + + return $this; + } + + public function getPriceAdditionalPerson(): ?int + { + return $this->priceAdditionalPerson; + } + + public function setPriceAdditionalPerson(int $priceAdditionalPerson): self + { + $this->priceAdditionalPerson = $priceAdditionalPerson; + + return $this; + } + + public function getMinNights(): ?int + { + return $this->minNights; + } + + public function setMinNights(int $minNights): self + { + $this->minNights = $minNights; + + return $this; + } +} diff --git a/src/Entity/Groups/AdditionalService.php b/src/Entity/Groups/AdditionalService.php new file mode 100644 index 00000000..772040f8 --- /dev/null +++ b/src/Entity/Groups/AdditionalService.php @@ -0,0 +1,150 @@ +id; + } + + public function getAccommodation(): ?Accommodation + { + return $this->accommodation; + } + + public function setAccommodation(?Accommodation $accommodation): self + { + $this->accommodation = $accommodation; + + return $this; + } + + public function getLabel(): ?string + { + return $this->label; + } + + public function setLabel(string $label): self + { + $this->label = $label; + + return $this; + } + + public function getPrice(): ?int + { + return $this->price; + } + + public function setPrice(int $price): self + { + $this->price = $price; + + return $this; + } + + public function getType(): ?AdditionalServiceType + { + return $this->type; + } + + public function setType(AdditionalServiceType $type): self + { + $this->type = $type; + + return $this; + } + + public function getDateFrom(): ?\DateTimeImmutable + { + return $this->dateFrom; + } + + public function setDateFrom(\DateTimeImmutable $dateFrom): self + { + $this->dateFrom = $dateFrom; + + return $this; + } + + public function getDateTo(): ?\DateTimeImmutable + { + return $this->dateTo; + } + + public function setDateTo(\DateTimeImmutable $dateTo): self + { + $this->dateTo = $dateTo; + + return $this; + } + + public function getGrouping(): ?string + { + return $this->grouping; + } + + public function setGrouping(?string $grouping): self + { + $this->grouping = $grouping; + + return $this; + } + + public function getSorting(): ?int + { + return $this->sorting; + } + + public function setSorting(?int $sorting): self + { + $this->sorting = $sorting; + + return $this; + } +} diff --git a/src/Entity/Groups/BoardService.php b/src/Entity/Groups/BoardService.php new file mode 100644 index 00000000..cca8850d --- /dev/null +++ b/src/Entity/Groups/BoardService.php @@ -0,0 +1,119 @@ +id; + } + + public function getAccommodation(): ?Accommodation + { + return $this->accommodation; + } + + public function setAccommodation(?Accommodation $accommodation): self + { + $this->accommodation = $accommodation; + + return $this; + } + + public function getLabel(): ?string + { + return $this->label; + } + + public function setLabel(string $label): self + { + $this->label = $label; + + return $this; + } + + public function getPrice(): ?int + { + return $this->price; + } + + public function setPrice(int $price): self + { + $this->price = $price; + + return $this; + } + + public function getDateFrom(): ?\DateTimeImmutable + { + return $this->dateFrom; + } + + public function setDateFrom(\DateTimeImmutable $dateFrom): self + { + $this->dateFrom = $dateFrom; + + return $this; + } + + public function getDateTo(): ?\DateTimeImmutable + { + return $this->dateTo; + } + + public function setDateTo(\DateTimeImmutable $dateTo): self + { + $this->dateTo = $dateTo; + + return $this; + } + + public function getSorting(): ?int + { + return $this->sorting; + } + + public function setSorting(?int $sorting): self + { + $this->sorting = $sorting; + + return $this; + } +} diff --git a/src/Entity/TimestampableEntity.php b/src/Entity/TimestampableEntity.php new file mode 100644 index 00000000..06b3c9e8 --- /dev/null +++ b/src/Entity/TimestampableEntity.php @@ -0,0 +1,38 @@ +createdAt; + } + + public function setCreatedAt(\DateTimeImmutable $createdAt): self + { + $this->createdAt = $createdAt; + + return $this; + } + + public function getUpdatedAt(): ?\DateTimeImmutable + { + return $this->updatedAt; + } + + public function setUpdatedAt(\DateTimeImmutable $updatedAt): self + { + $this->updatedAt = $updatedAt; + + return $this; + } +} diff --git a/src/Entity/TimestampableEntityInterface.php b/src/Entity/TimestampableEntityInterface.php new file mode 100644 index 00000000..0a3cb1ec --- /dev/null +++ b/src/Entity/TimestampableEntityInterface.php @@ -0,0 +1,14 @@ +getObject(); + + if (!$entity instanceof BlameableEntityInterface) { + return; + } + + $entity->setCreatedBy($this->security->getUser()); + } + + public function preUpdate(PreUpdateEventArgs $args): void + { + $entity = $args->getObject(); + + if (!$entity instanceof BlameableEntityInterface) { + return; + } + + $entity->setUpdatedBy($this->security->getUser()); + } +} diff --git a/src/EventListener/TimestampableEntityListener.php b/src/EventListener/TimestampableEntityListener.php new file mode 100644 index 00000000..02d7c7b8 --- /dev/null +++ b/src/EventListener/TimestampableEntityListener.php @@ -0,0 +1,34 @@ +getObject(); + + if ($entity instanceof TimestampableEntityInterface) { + $now = new \DateTimeImmutable(); + $entity->setCreatedAt($now); + } + } + + public function preUpdate(PreUpdateEventArgs $args): void + { + $entity = $args->getObject(); + + if ($entity instanceof TimestampableEntityInterface) { + $now = new \DateTimeImmutable(); + $entity->setUpdatedAt($now); + } + } +} diff --git a/src/Repository/Groups/AccommodationPriceRepository.php b/src/Repository/Groups/AccommodationPriceRepository.php new file mode 100644 index 00000000..49b69c46 --- /dev/null +++ b/src/Repository/Groups/AccommodationPriceRepository.php @@ -0,0 +1,43 @@ + + */ +class AccommodationPriceRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, AccommodationPrice::class); + } + + // /** + // * @return AccommodationPrice[] Returns an array of AccommodationPrice objects + // */ + // public function findByExampleField($value): array + // { + // return $this->createQueryBuilder('a') + // ->andWhere('a.exampleField = :val') + // ->setParameter('val', $value) + // ->orderBy('a.id', 'ASC') + // ->setMaxResults(10) + // ->getQuery() + // ->getResult() + // ; + // } + + // public function findOneBySomeField($value): ?AccommodationPrice + // { + // return $this->createQueryBuilder('a') + // ->andWhere('a.exampleField = :val') + // ->setParameter('val', $value) + // ->getQuery() + // ->getOneOrNullResult() + // ; + // } +} diff --git a/src/Repository/Groups/AccommodationRepository.php b/src/Repository/Groups/AccommodationRepository.php new file mode 100644 index 00000000..02342e59 --- /dev/null +++ b/src/Repository/Groups/AccommodationRepository.php @@ -0,0 +1,43 @@ + + */ +class AccommodationRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Accommodation::class); + } + + // /** + // * @return Accommodation[] Returns an array of Accommodation objects + // */ + // public function findByExampleField($value): array + // { + // return $this->createQueryBuilder('a') + // ->andWhere('a.exampleField = :val') + // ->setParameter('val', $value) + // ->orderBy('a.id', 'ASC') + // ->setMaxResults(10) + // ->getQuery() + // ->getResult() + // ; + // } + + // public function findOneBySomeField($value): ?Accommodation + // { + // return $this->createQueryBuilder('a') + // ->andWhere('a.exampleField = :val') + // ->setParameter('val', $value) + // ->getQuery() + // ->getOneOrNullResult() + // ; + // } +} diff --git a/src/Repository/Groups/AdditionalServiceRepository.php b/src/Repository/Groups/AdditionalServiceRepository.php new file mode 100644 index 00000000..0bc2160b --- /dev/null +++ b/src/Repository/Groups/AdditionalServiceRepository.php @@ -0,0 +1,18 @@ + + */ +class AdditionalServiceRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, AdditionalService::class); + } +} diff --git a/src/Repository/Groups/BoardServiceRepository.php b/src/Repository/Groups/BoardServiceRepository.php new file mode 100644 index 00000000..4fd1ce60 --- /dev/null +++ b/src/Repository/Groups/BoardServiceRepository.php @@ -0,0 +1,18 @@ + + */ +class BoardServiceRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, BoardService::class); + } +}