Added RoomCategory BedType support in AdminPanel

This commit is contained in:
2024-09-10 18:09:00 +02:00
parent 975d0495a8
commit 048681e8ad
9 changed files with 255 additions and 18 deletions
+5
View File
@@ -3,6 +3,7 @@
namespace App\Entity;
use App\Repository\BedTypeRepository;
use Symfony\Component\Serializer\Annotation\Ignore;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: BedTypeRepository::class)]
@@ -47,4 +48,8 @@ class BedType
return $this;
}
public function __toString(): string {
return $this->getName();
}
}
+7 -4
View File
@@ -3,6 +3,7 @@
namespace App\Entity;
use App\Repository\RoomCategoryBedTypeRepository;
use Symfony\Component\Serializer\Annotation\Ignore;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: RoomCategoryBedTypeRepository::class)]
@@ -21,10 +22,10 @@ class RoomCategoryBedType
#[ORM\Column]
private ?int $amount = null;
public function __construct(RoomCategory $roomCat, BedType $bedType) {
$this->roomCategory = $roomCat;
$this->bedType = $bedType;
}
// public function __construct(RoomCategory $roomCat, BedType $bedType) {
// $this->roomCategory = $roomCat;
// $this->bedType = $bedType;
// }
public function getAmount(): ?int
{
@@ -38,11 +39,13 @@ class RoomCategoryBedType
return $this;
}
#[Ignore]
public function getRoomCategory(): ?RoomCategory
{
return $this->roomCategory;
}
#[Ignore]
public function setRoomCategory(?RoomCategory $roomCategory): static
{
$this->roomCategory = $roomCategory;