src/Entity/Lieu.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LieuRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassLieuRepository::class)]
  9. class Lieu
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $name null;
  17.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  18.     private ?string $adresse null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     private ?string $codepostal null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $ville null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $latitude null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $longitude null;
  27.     #[ORM\OneToMany(mappedBy'lieu_new'targetEntityPost::class)]
  28.     private Collection $posts;
  29.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  30.     private ?string $openagenda_id null;
  31.     public function __construct()
  32.     {
  33.         $this->posts = new ArrayCollection();
  34.     }
  35.     public function __toString()
  36.     {
  37.         return $this->name.' '.$this->ville;
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getName(): ?string
  44.     {
  45.         return $this->name;
  46.     }
  47.     public function setName(?string $name): static
  48.     {
  49.         $this->name $name;
  50.         return $this;
  51.     }
  52.     public function getAdresse(): ?string
  53.     {
  54.         return $this->adresse;
  55.     }
  56.     public function setAdresse(?string $adresse): static
  57.     {
  58.         $this->adresse $adresse;
  59.         return $this;
  60.     }
  61.     public function getCodepostal(): ?string
  62.     {
  63.         return $this->codepostal;
  64.     }
  65.     public function setCodepostal(?string $codepostal): static
  66.     {
  67.         $this->codepostal $codepostal;
  68.         return $this;
  69.     }
  70.     public function getVille(): ?string
  71.     {
  72.         return $this->ville;
  73.     }
  74.     public function setVille(?string $ville): static
  75.     {
  76.         $this->ville $ville;
  77.         return $this;
  78.     }
  79.     public function getLatitude(): ?string
  80.     {
  81.         return $this->latitude;
  82.     }
  83.     public function setLatitude(?string $latitude): static
  84.     {
  85.         $this->latitude $latitude;
  86.         return $this;
  87.     }
  88.     public function getLongitude(): ?string
  89.     {
  90.         return $this->longitude;
  91.     }
  92.     public function setLongitude(?string $longitude): static
  93.     {
  94.         $this->longitude $longitude;
  95.         return $this;
  96.     }
  97.     /**
  98.      * @return Collection<int, Post>
  99.      */
  100.     public function getPosts(): Collection
  101.     {
  102.         return $this->posts;
  103.     }
  104.     public function addPost(Post $post): static
  105.     {
  106.         if (!$this->posts->contains($post)) {
  107.             $this->posts->add($post);
  108.             $post->setLieuNew($this);
  109.         }
  110.         return $this;
  111.     }
  112.     public function removePost(Post $post): static
  113.     {
  114.         if ($this->posts->removeElement($post)) {
  115.             // set the owning side to null (unless already changed)
  116.             if ($post->getLieuNew() === $this) {
  117.                 $post->setLieuNew(null);
  118.             }
  119.         }
  120.         return $this;
  121.     }
  122.     public function getOpenagendaId(): ?string
  123.     {
  124.         return $this->openagenda_id;
  125.     }
  126.     public function setOpenagendaId(?string $openagenda_id): static
  127.     {
  128.         $this->openagenda_id $openagenda_id;
  129.         return $this;
  130.     }
  131. }