<?phpnamespace MedBrief\MSR\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use MedBrief\MSR\Repository\InstanceRepository;use Ramsey\Uuid\UuidInterface;/** * @ORM\Entity(repositoryClass=InstanceRepository::class) * * @ORM\Table(name="Instance", indexes={@ORM\Index(name="orthancId_index", columns={"orthancId"})}) */class Instance{ /** * @var UuidInterface * * @ORM\Column(name="id", type="uuid") * * @ORM\Id * * @ORM\GeneratedValue(strategy="CUSTOM") * * @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator") */ private $id; /** * @ORM\Column(type="string", length=255) */ private string $orthancId; /** * @ORM\ManyToOne(targetEntity=Series::class, inversedBy="instances") * * @ORM\JoinColumn(nullable=false) */ private Series $parentSeries; /** * @var ArrayCollection * * @ORM\ManyToMany(targetEntity=Disc::class, inversedBy="instances") */ private $discs; /** * @var Project|null * * @ORM\ManyToOne(targetEntity=Project::class, inversedBy="instances") */ private ?Project $project; public function __construct() { $this->discs = new ArrayCollection(); } /** * @return UuidInterface|null */ public function getId(): ?UuidInterface { return $this->id; } /** * @return string|null */ public function getOrthancId(): ?string { return $this->orthancId; } /** * @param string $orthancId * * @return $this */ public function setOrthancId(string $orthancId): self { $this->orthancId = $orthancId; return $this; } /** * @return Series|null */ public function getParentSeries(): ?Series { return $this->parentSeries; } /** * @param Series|null $parentSeries * * @return $this */ public function setParentSeries(?Series $parentSeries): self { $this->parentSeries = $parentSeries; return $this; } /** * @return Collection<int, Disc> */ public function getDiscs(): Collection { return $this->discs; } /** * @param Disc $disc * * @return $this */ public function addDisc(Disc $disc): self { if (!$this->discs->contains($disc)) { $this->discs[] = $disc; } return $this; } /** * @param Disc $disc * * @return $this */ public function removeDisc(Disc $disc): self { $this->discs->removeElement($disc); return $this; } /** * @return Project|null */ public function getProject(): ?Project { return $this->project; } /** * @param Project $project * * @return Instance */ public function setProject(Project $project): Instance { $this->project = $project; return $this; }}