<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\EvenementNewsletterRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: EvenementNewsletterRepository::class)]
#[ApiResource]
class EvenementNewsletter
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $description = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $objet = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $affiche = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $datesend = null;
#[ORM\OneToMany(mappedBy: 'news', targetEntity: PieceNews::class,cascade: ['remove'])]
private Collection $pieceNews;
#[ORM\Column(nullable: true)]
private ?bool $isPartenaire = null;
#[ORM\Column(nullable: true)]
private ?bool $isStagiaire = null;
#[ORM\Column(nullable: true)]
private ?bool $isFormateur = null;
#[ORM\Column(nullable: true)]
private ?bool $isTous = null;
#[ORM\Column(nullable: true)]
private array $tabsession = [];
#[ORM\OneToMany(mappedBy: 'newsletter', targetEntity: Trace::class,cascade: ['remove'])]
private Collection $traces;
public function __construct()
{
$this->pieceNews = new ArrayCollection();
$this->traces = 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;
}
public function getObjet(): ?string
{
return $this->objet;
}
public function setObjet(?string $objet): self
{
$this->objet = $objet;
return $this;
}
public function getAffiche(): ?string
{
return $this->affiche;
}
public function setAffiche(?string $affiche): self
{
$this->affiche = $affiche;
return $this;
}
public function getDatesend(): ?\DateTimeInterface
{
return $this->datesend;
}
public function setDatesend(?\DateTimeInterface $datesend): self
{
$this->datesend = $datesend;
return $this;
}
/**
* @return Collection<int, PieceNews>
*/
public function getPieceNews(): Collection
{
return $this->pieceNews;
}
public function addPieceNews(PieceNews $pieceNews): self
{
if (!$this->pieceNews->contains($pieceNews)) {
$this->pieceNews->add($pieceNews);
$pieceNews->setNews($this);
}
return $this;
}
public function removePieceNews(PieceNews $pieceNews): self
{
if ($this->pieceNews->removeElement($pieceNews)) {
// set the owning side to null (unless already changed)
if ($pieceNews->getNews() === $this) {
$pieceNews->setNews(null);
}
}
return $this;
}
public function isIsPartenaire(): ?bool
{
return $this->isPartenaire;
}
public function setIsPartenaire(?bool $isPartenaire): self
{
$this->isPartenaire = $isPartenaire;
return $this;
}
public function isIsStagiaire(): ?bool
{
return $this->isStagiaire;
}
public function setIsStagiaire(?bool $isStagiaire): self
{
$this->isStagiaire = $isStagiaire;
return $this;
}
public function isIsFormateur(): ?bool
{
return $this->isFormateur;
}
public function setIsFormateur(?bool $isFormateur): self
{
$this->isFormateur = $isFormateur;
return $this;
}
public function isIsTous(): ?bool
{
return $this->isTous;
}
public function setIsTous(?bool $isTous): self
{
$this->isTous = $isTous;
return $this;
}
public function getTabsession(): array
{
return $this->tabsession;
}
public function setTabsession(?array $tabsession): self
{
$this->tabsession = $tabsession;
return $this;
}
/**
* @return Collection<int, Trace>
*/
public function getTraces(): Collection
{
return $this->traces;
}
public function addTrace(Trace $trace): self
{
if (!$this->traces->contains($trace)) {
$this->traces->add($trace);
$trace->setNewsletter($this);
}
return $this;
}
public function removeTrace(Trace $trace): self
{
if ($this->traces->removeElement($trace)) {
// set the owning side to null (unless already changed)
if ($trace->getNewsletter() === $this) {
$trace->setNewsletter(null);
}
}
return $this;
}
}