diff --git a/src/Entity/File.php b/src/Entity/File.php index 39432fc6e3a3380acb523ad6e57bd81390f5a946..712eb87b58029a09d98d125e05eca3873c9561e2 100644 --- a/src/Entity/File.php +++ b/src/Entity/File.php @@ -10,6 +10,7 @@ use Symfony\Component\Uid\Uuid; class File { #[ORM\Id] + #[ORM\GeneratedValue] #[ORM\Column(type: 'uuid', unique: true)] private ?Uuid $id = null; diff --git a/src/Entity/Gallery.php b/src/Entity/Gallery.php index 1edce964a4635a2a3c60c1e8427e2e60f6bd3131..05dd42a60893121c51ccbb0829d547218ab3abad 100644 --- a/src/Entity/Gallery.php +++ b/src/Entity/Gallery.php @@ -4,14 +4,15 @@ namespace App\Entity; use App\Repository\GalleryRepository; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Uid\Uuid; #[ORM\Entity(repositoryClass: GalleryRepository::class)] class Gallery { #[ORM\Id] #[ORM\GeneratedValue] - #[ORM\Column] - private ?int $id = null; + #[ORM\Column(type: 'uuid', unique: true)] + private ?Uuid $id = null; #[ORM\ManyToOne(inversedBy: 'galleries')] #[ORM\JoinColumn(nullable: false)] diff --git a/src/Entity/Kitchen.php b/src/Entity/Kitchen.php index 0315324e71b05c67e54ec570379e42534e8fbbe7..91a71a3335d542b41aa784aa1c30feb71d67aa5c 100644 --- a/src/Entity/Kitchen.php +++ b/src/Entity/Kitchen.php @@ -10,6 +10,7 @@ use Symfony\Component\Uid\Uuid; class Kitchen { #[ORM\Id] + #[ORM\GeneratedValue] #[ORM\Column(type: 'uuid', unique: true)] private ?Uuid $id = null; diff --git a/src/Entity/News.php b/src/Entity/News.php index 101e54b026457a0835336fa6c4bfb5a51cce71a7..b5020dbaf3e172f1ebbacf205d7b48f883870584 100644 --- a/src/Entity/News.php +++ b/src/Entity/News.php @@ -13,6 +13,7 @@ use Symfony\Component\Uid\Uuid; class News { #[ORM\Id] + #[ORM\GeneratedValue] #[ORM\Column(type: 'uuid', unique: true)] private ?Uuid $id = null; diff --git a/src/Entity/NewsCategory.php b/src/Entity/NewsCategory.php index 3ab4411b5c726193e614def120ff7c08cca69cdc..ea523137976611f895f66af7f01c95fbf5ad7b67 100644 --- a/src/Entity/NewsCategory.php +++ b/src/Entity/NewsCategory.php @@ -11,6 +11,7 @@ use Symfony\Component\Uid\Uuid; class NewsCategory { #[ORM\Id] + #[ORM\GeneratedValue] #[ORM\Column(type: 'uuid', unique: true)] private ?Uuid $id = null; diff --git a/src/Entity/NewsComment.php b/src/Entity/NewsComment.php index 683c3241f11af3c344950b74706d50e4bb9d1f42..46c066d656c547917ca3a291534c8ba91446fc81 100644 --- a/src/Entity/NewsComment.php +++ b/src/Entity/NewsComment.php @@ -11,6 +11,7 @@ use Symfony\Component\Uid\Uuid; class NewsComment { #[ORM\Id] + #[ORM\GeneratedValue] #[ORM\Column(type: 'uuid', unique: true)] private ?Uuid $id = null; diff --git a/src/Entity/NewsType.php b/src/Entity/NewsType.php index 27b05d3c7fcd38da22844cbff2259e03ea0e2b2b..abd94e1a25e87dcaa90b4b4a39b8388f0d3078d8 100644 --- a/src/Entity/NewsType.php +++ b/src/Entity/NewsType.php @@ -12,6 +12,7 @@ use Symfony\Component\Uid\Uuid; class NewsType { #[ORM\Id] + #[ORM\GeneratedValue] #[ORM\Column(type: 'uuid', unique: true)] private ?Uuid $id = null; diff --git a/src/Entity/Restaurant.php b/src/Entity/Restaurant.php index e2aa8727741e36b41f2379552a375647e371f9f8..149fe6bbecd33977b86e21b4c285571c3d617bf3 100644 --- a/src/Entity/Restaurant.php +++ b/src/Entity/Restaurant.php @@ -13,6 +13,7 @@ use Symfony\Component\Uid\Uuid; class Restaurant { #[ORM\Id] + #[ORM\GeneratedValue] #[ORM\Column(type: 'uuid', unique: true)] private ?Uuid $id = null; @@ -60,14 +61,14 @@ class Restaurant #[ORM\OneToMany(targetEntity: Kitchen::class, mappedBy: 'restaurant')] private Collection $kitchen; - #[ORM\Column(type: Types::JSON)] - private Collection $phone; + #[ORM\Column] + private array $phone = []; - #[ORM\Column(type: Types::JSON)] - private Collection $email; + #[ORM\Column] + private array $email = []; - #[ORM\Column(type: Types::JSON)] - private Collection $address; + #[ORM\Column] + private array $address = []; /** * @var Collection @@ -100,9 +101,6 @@ class Restaurant public function __construct() { $this->kitchen = new ArrayCollection(); - $this->phone = new ArrayCollection(); - $this->email = new ArrayCollection(); - $this->address = new ArrayCollection(); $this->tags = new ArrayCollection(); $this->galleries = new ArrayCollection(); } @@ -286,96 +284,6 @@ class Restaurant return $this; } - /** - * @return Collection - */ - public function getPhone(): Collection - { - return $this->phone; - } - - public function addPhone(Phone $phone): static - { - if (!$this->phone->contains($phone)) { - $this->phone->add($phone); - $phone->setRestaurant($this); - } - - return $this; - } - - public function removePhone(Phone $phone): static - { - if ($this->phone->removeElement($phone)) { - // set the owning side to null (unless already changed) - if ($phone->getRestaurant() === $this) { - $phone->setRestaurant(null); - } - } - - return $this; - } - - /** - * @return Collection - */ - public function getEmail(): Collection - { - return $this->email; - } - - public function addEmail(Email $email): static - { - if (!$this->email->contains($email)) { - $this->email->add($email); - $email->setRestaurant($this); - } - - return $this; - } - - public function removeEmail(Email $email): static - { - if ($this->email->removeElement($email)) { - // set the owning side to null (unless already changed) - if ($email->getRestaurant() === $this) { - $email->setRestaurant(null); - } - } - - return $this; - } - - /** - * @return Collection - */ - public function getAddress(): Collection - { - return $this->address; - } - - public function addAddress(Address $address): static - { - if (!$this->address->contains($address)) { - $this->address->add($address); - $address->setRestaurant($this); - } - - return $this; - } - - public function removeAddress(Address $address): static - { - if ($this->address->removeElement($address)) { - // set the owning side to null (unless already changed) - if ($address->getRestaurant() === $this) { - $address->setRestaurant(null); - } - } - - return $this; - } - /** * @return Collection */ @@ -495,4 +403,25 @@ class Restaurant return $this; } + + public function setPhone(array $phone): static + { + $this->phone = $phone; + + return $this; + } + + public function setEmail(array $email): static + { + $this->email = $email; + + return $this; + } + + public function setAddress(array $address): static + { + $this->address = $address; + + return $this; + } } diff --git a/src/Entity/RestaurantType.php b/src/Entity/RestaurantType.php index eb59ef74a568cd551b54978d6d943b7e60bb72d5..447b0ee4f0f62de708b4a1d21971ba5a9cd3805c 100644 --- a/src/Entity/RestaurantType.php +++ b/src/Entity/RestaurantType.php @@ -12,6 +12,7 @@ use Symfony\Component\Uid\Uuid; class RestaurantType { #[ORM\Id] + #[ORM\GeneratedValue] #[ORM\Column(type: 'uuid', unique: true)] private ?Uuid $id = null; diff --git a/src/Entity/Seo.php b/src/Entity/Seo.php index e68bb3036f221d08634c076ac2eeda760e62192b..59d214003933c77a335d3a790f71749852d96bea 100644 --- a/src/Entity/Seo.php +++ b/src/Entity/Seo.php @@ -10,6 +10,7 @@ use Symfony\Component\Uid\Uuid; class Seo { #[ORM\Id] + #[ORM\GeneratedValue] #[ORM\Column(type: 'uuid', unique: true)] private ?Uuid $id = null; diff --git a/src/Entity/Settlement.php b/src/Entity/Settlement.php index 94d8e4d50e88009c1e812d51e8aeeab36b07531d..b6cb733648bc8b8286f75bbe14b61ff9e7874008 100644 --- a/src/Entity/Settlement.php +++ b/src/Entity/Settlement.php @@ -13,6 +13,7 @@ use Symfony\Component\Uid\Uuid; class Settlement { #[ORM\Id] + #[ORM\GeneratedValue] #[ORM\Column(type: 'uuid', unique: true)] private ?Uuid $id = null; diff --git a/src/Entity/Tags.php b/src/Entity/Tags.php index a52ff23c9365872ab7c38a6e2eada3b45bc6d664..03c7186f1407d1914d0e1e6f8fd9ec837b319195 100644 --- a/src/Entity/Tags.php +++ b/src/Entity/Tags.php @@ -11,6 +11,7 @@ use Symfony\Component\Uid\Uuid; class Tags { #[ORM\Id] + #[ORM\GeneratedValue] #[ORM\Column(type: 'uuid', unique: true)] private ?Uuid $id = null; diff --git a/src/Entity/User.php b/src/Entity/User.php index 208382fc713df48214b2631cbee86d5ac6128736..1939b591837d05d95c45e97932173a776b265f03 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -13,6 +13,7 @@ use Symfony\Component\Uid\Uuid; class User { #[ORM\Id] + #[ORM\GeneratedValue] #[ORM\Column(type: 'uuid', unique: true)] private ?Uuid $id = null;