src/Entity/CommercialNotification.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CommercialNotificationRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CommercialNotificationRepository::class)
  9.  */
  10. class CommercialNotification
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $description;
  22.     /**
  23.      * @ORM\ManyToMany(targetEntity=User::class)
  24.      */
  25.     private $user;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=Chantier::class, inversedBy="commercialNotifications")
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private $chantier;
  31.     public function __construct()
  32.     {
  33.         $this->user = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getDescription(): ?string
  40.     {
  41.         return $this->description;
  42.     }
  43.     public function setDescription(string $description): self
  44.     {
  45.         $this->description $description;
  46.         return $this;
  47.     }
  48.     /**
  49.      * @return Collection|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[] = $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 getChantier(): ?Chantier
  68.     {
  69.         return $this->chantier;
  70.     }
  71.     public function setChantier(?Chantier $chantier): self
  72.     {
  73.         $this->chantier $chantier;
  74.         return $this;
  75.     }
  76. }