<?php
namespace App\Entity;
use App\Repository\NotificationRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: NotificationRepository::class)]
class Notification
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $titre = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $sousTitre = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $description = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $image = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $type = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $date = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $lien = null;
#[ORM\OneToMany(mappedBy: 'notification', targetEntity: NotificationSession::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
private Collection $notificationSessions;
#[ORM\Column(length: 255, nullable: true)]
private ?string $programme = null;
public function __construct()
{
$this->notificationSessions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(?string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getSousTitre(): ?string
{
return $this->sousTitre;
}
public function setSousTitre(?string $sousTitre): self
{
$this->sousTitre = $sousTitre;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(?\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getLien(): ?string
{
return $this->lien;
}
public function setLien(?string $lien): self
{
$this->lien = $lien;
return $this;
}
/**
* @return Collection<int, NotificationSession>
*/
public function getNotificationSessions(): Collection
{
return $this->notificationSessions;
}
public function addNotificationSession(NotificationSession $notificationSession): self
{
if (!$this->notificationSessions->contains($notificationSession)) {
$this->notificationSessions->add($notificationSession);
$notificationSession->setNotification($this);
}
return $this;
}
public function removeNotificationSession(NotificationSession $notificationSession): self
{
if ($this->notificationSessions->removeElement($notificationSession)) {
// set the owning side to null (unless already changed)
if ($notificationSession->getNotification() === $this) {
$notificationSession->setNotification(null);
}
}
return $this;
}
public function getProgramme(): ?string
{
return $this->programme;
}
public function setProgramme(?string $programme): self
{
$this->programme = $programme;
return $this;
}
}