<?phpnamespace App\Entity;use DateTime;use App\Repository\RingBatchRepository;use Doctrine\ORM\Mapping as ORM;use Doctrine\Common\Collections\Collection;use Doctrine\Common\Collections\ArrayCollection;/** * @ORM\Entity(repositoryClass=RingBatchRepository::class) */class RingBatch{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $storage; /** * @ORM\Column(type="string", length=50) */ private $model; /** * @ORM\ManyToOne(targetEntity=Institution::class, inversedBy="ringBatches") */ private $institution; /** * @ORM\OneToMany(targetEntity=Ring::class, mappedBy="batch") */ private $rings; /** * @ORM\Column(type="datetime") */ private $creation_date; /** * @ORM\Column(type="string", length=255) */ private $start_series; /** * @ORM\Column(type="string", length=255) */ private $end_series; /** * @ORM\Column(type="integer") */ private $amount; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $observations; public function __construct() { $this->rings = new ArrayCollection(); $this->creation_date = new DateTime(); } public function getId(): ?int { return $this->id; } public function getStorage(): ?string { return $this->storage; } public function setStorage(string $storage): self { $this->storage = $storage; return $this; } public function getModel(): ?string { return $this->model; } public function setModel(string $model): self { $this->model = $model; return $this; } public function getInstitution(): ?Institution { return $this->institution; } public function setInstitution(?Institution $institution): self { $this->institution = $institution; return $this; } public function getStartSeries(): ?string { return $this->start_series; } public function setStartSeries(string $start_series): self { $this->start_series = $start_series; return $this; } public function getEndSeries(): ?string { return $this->end_series; } public function setEndSeries(string $end_series): self { $this->end_series = $end_series; return $this; } public function getAmount(): ?int { return $this->amount; } public function setAmount(int $amount): self { $this->amount = $amount; return $this; } /** * @return Collection<int, Ring> */ public function getRings(): Collection { return $this->rings; } public function addRing(Ring $ring): self { if (!$this->rings->contains($ring)) { $this->rings[] = $ring; $ring->setBatch($this); } return $this; } public function removeRing(Ring $ring): self { if ($this->rings->removeElement($ring)) { // set the owning side to null (unless already changed) if ($ring->getBatch() === $this) { $ring->setBatch(null); } } return $this; } public function getCreationDate(): ?\DateTimeInterface { return $this->creation_date; } public function setCreationDate(\DateTimeInterface $creation_date): self { $this->creation_date = $creation_date; return $this; } public function getObservations(): ?string { return $this->observations; } public function setObservations(?string $observations): self { $this->observations = $observations; return $this; }}