<?php
namespace App\Entity;
use App\Repository\EncadrementRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use App\Enum\TypeEncadrement;
#[ORM\Entity(repositoryClass: EncadrementRepository::class)]
class Encadrement
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $fullname = null;
#[ORM\Column(length: 50, enumType: TypeEncadrement::class, nullable: true)]
private ?TypeEncadrement $type = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $titleofsubject = null;
#[ORM\Column(type: Types::DATETIME_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $Datedebut = null;
#[ORM\Column(type: Types::DATETIME_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $Datefin = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $email = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $telephone = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $lien = null;
#[ORM\ManyToMany(targetEntity: Publication::class, mappedBy: 'authors')]
private Collection $publications;
public function __construct()
{
$this->publications = new ArrayCollection();
}
public function getType(): ?TypeEncadrement
{
return $this->type;
}
public function setType(?TypeEncadrement $type): static
{
$this->type = $type;
return $this;
}
public function getId(): ?int
{
return $this->id;
}
public function getFullname(): ?string
{
return $this->fullname;
}
public function setFullname(?string $fullname): self
{
$this->fullname = $fullname;
return $this;
}
public function getTitleofsubject(): ?string
{
return $this->titleofsubject;
}
public function setTitleofsubject(?string $titleofsubject): self
{
$this->titleofsubject = $titleofsubject;
return $this;
}
public function getDatedebut(): ?\DateTimeImmutable
{
return $this->Datedebut;
}
public function setDatedebut(?\DateTimeImmutable $Datedebut): self
{
$this->Datedebut = $Datedebut;
return $this;
}
public function getDatefin(): ?\DateTimeImmutable
{
return $this->Datefin;
}
public function setDatefin(?\DateTimeImmutable $Datefin): self
{
$this->Datefin = $Datefin;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setTelephone(?string $telephone): self
{
$this->telephone = $telephone;
return $this;
}
public function getLien(): ?string
{
return $this->lien;
}
public function setLien(?string $lien): self
{
$this->lien = $lien;
return $this;
}
/**
* @return Collection<int, Publication>
*/
public function getPublications(): Collection
{
return $this->publications;
}
public function addPublication(Publication $publication): self
{
if (!$this->publications->contains($publication)) {
$this->publications->add($publication);
$publication->addAuthor($this);
}
return $this;
}
public function removePublication(Publication $publication): self
{
if ($this->publications->removeElement($publication)) {
$publication->removeAuthor($this);
}
return $this;
}
}