Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Entity;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * @ORM\Entity(repositoryClass="App\Repository\RestaurantsRepository")
- */
- class Restaurants
- {
- /**
- * @ORM\Id()
- * @ORM\GeneratedValue()
- * @ORM\Column(type="integer")
- */
- private $id;
- /**
- * @ORM\Column(type="string", length=255)
- */
- private $libelle;
- /**
- * @ORM\Column(type="text")
- */
- private $avatar;
- /**
- * @ORM\Column(type="string", length=255)
- */
- private $ville;
- /**
- * @ORM\Column(type="integer")
- */
- private $codePostal;
- /**
- * @ORM\Column(type="text")
- */
- private $localisation;
- /**
- * @ORM\OneToMany(targetEntity="App\Entity\Menu", mappedBy="resto")
- */
- private $menus;
- public function __construct()
- {
- $this->menus = new ArrayCollection();
- }
- public function getId(): ?int
- {
- return $this->id;
- }
- public function getLibelle(): ?string
- {
- return $this->libelle;
- }
- public function setLibelle(string $libelle): self
- {
- $this->libelle = $libelle;
- return $this;
- }
- public function getAvatar(): ?string
- {
- return $this->avatar;
- }
- public function setAvatar(string $avatar): self
- {
- $this->avatar = $avatar;
- return $this;
- }
- public function getVille(): ?string
- {
- return $this->ville;
- }
- public function setVille(string $ville): self
- {
- $this->ville = $ville;
- return $this;
- }
- public function getCodePostal(): ?int
- {
- return $this->codePostal;
- }
- public function setCodePostal(int $codePostal): self
- {
- $this->codePostal = $codePostal;
- return $this;
- }
- public function getLocalisation(): ?string
- {
- return $this->localisation;
- }
- public function setLocalisation(string $localisation): self
- {
- $this->localisation = $localisation;
- return $this;
- }
- /**
- * @return Collection|Menu[]
- */
- public function getMenus(): Collection
- {
- return $this->menus;
- }
- public function addMenu(Menu $menu): self
- {
- if (!$this->menus->contains($menu)) {
- $this->menus[] = $menu;
- $menu->setResto($this);
- }
- return $this;
- }
- public function removeMenu(Menu $menu): self
- {
- if ($this->menus->contains($menu)) {
- $this->menus->removeElement($menu);
- // set the owning side to null (unless already changed)
- if ($menu->getResto() === $this) {
- $menu->setResto(null);
- }
- }
- return $this;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement