src/Entity/RingBatch.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use App\Repository\RingBatchRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. /**
  9.  * @ORM\Entity(repositoryClass=RingBatchRepository::class)
  10.  */
  11. class RingBatch
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $storage;
  23.     /**
  24.      * @ORM\Column(type="string", length=50)
  25.      */
  26.     private $model;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity=Institution::class, inversedBy="ringBatches")
  29.      */
  30.     private $institution;
  31.     /**
  32.      * @ORM\OneToMany(targetEntity=Ring::class, mappedBy="batch")
  33.      */
  34.     private $rings;
  35.     /**
  36.      * @ORM\Column(type="datetime")
  37.      */
  38.     private $creation_date;
  39.     /**
  40.      * @ORM\Column(type="string", length=255)
  41.      */
  42.     private $start_series;
  43.     /**
  44.      * @ORM\Column(type="string", length=255)
  45.      */
  46.     private $end_series;
  47.     /**
  48.      * @ORM\Column(type="integer")
  49.      */
  50.     private $amount;
  51.     /**
  52.      * @ORM\Column(type="string", length=255, nullable=true)
  53.      */
  54.     private $observations;
  55.     public function __construct()
  56.     {
  57.         $this->rings = new ArrayCollection();
  58.         $this->creation_date = new DateTime();
  59.     }
  60.     public function getId(): ?int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function getStorage(): ?string
  65.     {
  66.         return $this->storage;
  67.     }
  68.     public function setStorage(string $storage): self
  69.     {
  70.         $this->storage $storage;
  71.         return $this;
  72.     }
  73.     public function getModel(): ?string
  74.     {
  75.         return $this->model;
  76.     }
  77.     public function setModel(string $model): self
  78.     {
  79.         $this->model $model;
  80.         return $this;
  81.     }
  82.     public function getInstitution(): ?Institution
  83.     {
  84.         return $this->institution;
  85.     }
  86.     public function setInstitution(?Institution $institution): self
  87.     {
  88.         $this->institution $institution;
  89.         return $this;
  90.     }
  91.     public function getStartSeries(): ?string
  92.     {
  93.         return $this->start_series;
  94.     }
  95.     public function setStartSeries(string $start_series): self
  96.     {
  97.         $this->start_series $start_series;
  98.         return $this;
  99.     }
  100.     public function getEndSeries(): ?string
  101.     {
  102.         return $this->end_series;
  103.     }
  104.     public function setEndSeries(string $end_series): self
  105.     {
  106.         $this->end_series $end_series;
  107.         return $this;
  108.     }
  109.     public function getAmount(): ?int
  110.     {
  111.         return $this->amount;
  112.     }
  113.     public function setAmount(int $amount): self
  114.     {
  115.         $this->amount $amount;
  116.         return $this;
  117.     }
  118.     /**
  119.      * @return Collection<int, Ring>
  120.      */
  121.     public function getRings(): Collection
  122.     {
  123.         return $this->rings;
  124.     }
  125.     public function addRing(Ring $ring): self
  126.     {
  127.         if (!$this->rings->contains($ring)) {
  128.             $this->rings[] = $ring;
  129.             $ring->setBatch($this);
  130.         }
  131.         return $this;
  132.     }
  133.     public function removeRing(Ring $ring): self
  134.     {
  135.         if ($this->rings->removeElement($ring)) {
  136.             // set the owning side to null (unless already changed)
  137.             if ($ring->getBatch() === $this) {
  138.                 $ring->setBatch(null);
  139.             }
  140.         }
  141.         return $this;
  142.     }
  143.     public function getCreationDate(): ?\DateTimeInterface
  144.     {
  145.         return $this->creation_date;
  146.     }
  147.     public function setCreationDate(\DateTimeInterface $creation_date): self
  148.     {
  149.         $this->creation_date $creation_date;
  150.         return $this;
  151.     }
  152.     public function getObservations(): ?string
  153.     {
  154.         return $this->observations;
  155.     }
  156.     public function setObservations(?string $observations): self
  157.     {
  158.         $this->observations $observations;
  159.         return $this;
  160.     }
  161. }