<?php
namespace App\Entity;
use App\Repository\CommercialNotificationRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CommercialNotificationRepository::class)
*/
class CommercialNotification
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $description;
/**
* @ORM\ManyToMany(targetEntity=User::class)
*/
private $user;
/**
* @ORM\ManyToOne(targetEntity=Chantier::class, inversedBy="commercialNotifications")
* @ORM\JoinColumn(nullable=false)
*/
private $chantier;
public function __construct()
{
$this->user = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
/**
* @return Collection|User[]
*/
public function getUser(): Collection
{
return $this->user;
}
public function addUser(User $user): self
{
if (!$this->user->contains($user)) {
$this->user[] = $user;
}
return $this;
}
public function removeUser(User $user): self
{
$this->user->removeElement($user);
return $this;
}
public function getChantier(): ?Chantier
{
return $this->chantier;
}
public function setChantier(?Chantier $chantier): self
{
$this->chantier = $chantier;
return $this;
}
}