src/Entity/RateRestaurant.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RateRestaurantRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassRateRestaurantRepository::class)]
  8. class RateRestaurant
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\ManyToMany(targetEntityRestaurant::class, inversedBy'rateRestaurants')]
  15.     private Collection $restaurant;
  16.     #[ORM\ManyToMany(targetEntityUser::class, inversedBy'rateRestaurants')]
  17.     private Collection $user;
  18.     #[ORM\Column(length255)]
  19.     private ?string $numberOfStart null;
  20.     public function __construct()
  21.     {
  22.         $this->restaurant = new ArrayCollection();
  23.         $this->user = new ArrayCollection();
  24.     }
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     /**
  30.      * @return Collection<int, Restaurant>
  31.      */
  32.     // public function getRestaurant(): Collection
  33.     // {
  34.     //     return $this->restaurant;
  35.     // }
  36.     public function addRestaurant(Restaurant $restaurant): self
  37.     {
  38.         if (!$this->restaurant->contains($restaurant)) {
  39.             $this->restaurant->add($restaurant);
  40.         }
  41.         return $this;
  42.     }
  43.     public function removeRestaurant(Restaurant $restaurant): self
  44.     {
  45.         $this->restaurant->removeElement($restaurant);
  46.         return $this;
  47.     }
  48.     /**
  49.      * @return Collection<int, User>
  50.      */
  51.    /*  public function getUser(): Collection
  52.     {
  53.         return $this->user;
  54.     } */
  55.     public function addUser(User $user): self
  56.     {
  57.         if (!$this->user->contains($user)) {
  58.             $this->user->add($user);
  59.         }
  60.         return $this;
  61.     }
  62.     public function removeUser(User $user): self
  63.     {
  64.         $this->user->removeElement($user);
  65.         return $this;
  66.     }
  67.     public function getNumberOfStart(): ?string
  68.     {
  69.         return $this->numberOfStart;
  70.     }
  71.     public function setNumberOfStart(string $numberOfStart): self
  72.     {
  73.         $this->numberOfStart $numberOfStart;
  74.         return $this;
  75.     }
  76. }