<?phpnamespace App\Entity;use App\Repository\PublicationRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: PublicationRepository::class)]class Publication{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255, nullable: true)] private ?string $title = null; #[ORM\Column(length: 255, nullable: true)] private ?string $booktitle = null; #[ORM\Column(length: 255, nullable: true)] private ?string $pages = null; #[ORM\Column(length: 255, nullable: true)] private ?string $year = null; #[ORM\Column(length: 255, nullable: true)] private ?string $organization = null; #[ORM\ManyToMany(targetEntity: Encadrement::class, inversedBy: 'publications')] private Collection $authors; public function __construct() { $this->authors = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getTitle(): ?string { return $this->title; } public function setTitle(?string $title): self { $this->title = $title; return $this; } public function getBooktitle(): ?string { return $this->booktitle; } public function setBooktitle(?string $booktitle): self { $this->booktitle = $booktitle; return $this; } public function getPages(): ?string { return $this->pages; } public function setPages(?string $pages): self { $this->pages = $pages; return $this; } public function getYear(): ?string { return $this->year; } public function setYear(?string $year): self { $this->year = $year; return $this; } public function getOrganization(): ?string { return $this->organization; } public function setOrganization(?string $organization): self { $this->organization = $organization; return $this; } /** * @return Collection<int, Encadrement> */ public function getAuthors(): Collection { return $this->authors; } public function addAuthor(Encadrement $author): self { if (!$this->authors->contains($author)) { $this->authors->add($author); } return $this; } public function removeAuthor(Encadrement $author): self { $this->authors->removeElement($author); return $this; }}