src/Entity/Ring.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use App\Repository\RingRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=RingRepository::class)
  8.  */
  9. class Ring
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=10)
  19.      */
  20.     private $ring_code;
  21.     /**
  22.      * @ORM\Column(type="date", nullable=true)
  23.      */
  24.     private $delivery_date;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity=Institution::class, inversedBy="ring")
  27.      */
  28.     private $institution;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity=Ringer::class, inversedBy="rings")
  31.      */
  32.     private $owner_ringer;
  33.     /**
  34.      * @ORM\ManyToOne(targetEntity=Group::class, inversedBy="rings")
  35.      */
  36.     private $owner_group;
  37.     /**
  38.      * @ORM\ManyToOne(targetEntity=Institution::class, inversedBy="rings")
  39.      */
  40.     private $owner_office;
  41.     /**
  42.      * @ORM\Column(type="datetime")
  43.      */
  44.     private $creation_date;
  45.     /**
  46.      * @ORM\Column(type="string", length=15)
  47.      */
  48.     private $status;
  49.     /**
  50.      * @ORM\Column(type="string", length=255)
  51.      */
  52.     private $model;
  53.     /**
  54.      * @ORM\Column(type="string", length=255)
  55.      */
  56.     private $number;
  57.     /**
  58.      * @ORM\Column(type="string", length=10)
  59.      */
  60.     private $euring_ring_code;
  61.     /**
  62.      * @ORM\OneToOne(targetEntity=Register::class, mappedBy="ring", cascade={"persist", "remove"})
  63.      */
  64.     private $register;
  65.     /**
  66.      * @ORM\ManyToOne(targetEntity=RingBatch::class, inversedBy="rings")
  67.      * @ORM\JoinColumn(nullable=false)
  68.      */
  69.     private $batch;
  70.     public function __construct()
  71.     {
  72.         $this->creation_date = new DateTime();
  73.     }
  74.     public function __toString()
  75.     {
  76.         return $this->ring_code;
  77.     }
  78.     public function getId(): ?int
  79.     {
  80.         return $this->id;
  81.     }
  82.     public function getRingCode(): ?string
  83.     {
  84.         return $this->ring_code;
  85.     }
  86.     public function setRingCode(string $ring_code): self
  87.     {
  88.         $this->ring_code $ring_code;
  89.         return $this;
  90.     }
  91.     public function getDeliveryDate(): ?\DateTimeInterface
  92.     {
  93.         return $this->delivery_date;
  94.     }
  95.     public function setDeliveryDate(?\DateTimeInterface $delivery_date): self
  96.     {
  97.         $this->delivery_date $delivery_date;
  98.         return $this;
  99.     }
  100.     public function getInstitution(): ?Institution
  101.     {
  102.         return $this->institution;
  103.     }
  104.     public function setInstitution(?Institution $institution): self
  105.     {
  106.         $this->institution $institution;
  107.         return $this;
  108.     }
  109.     public function getOwnerRinger(): ?Ringer
  110.     {
  111.         return $this->owner_ringer;
  112.     }
  113.     public function setOwnerRinger(?Ringer $owner_ringer): self
  114.     {
  115.         $this->owner_ringer $owner_ringer;
  116.         return $this;
  117.     }
  118.     public function getOwnerGroup(): ?Group
  119.     {
  120.         return $this->owner_group;
  121.     }
  122.     public function setOwnerGroup(?Group $owner_group): self
  123.     {
  124.         $this->owner_group $owner_group;
  125.         return $this;
  126.     }
  127.     public function getOwnerOffice(): ?Institution
  128.     {
  129.         return $this->owner_office;
  130.     }
  131.     public function setOwnerOffice(?Institution $owner_office): self
  132.     {
  133.         $this->owner_office $owner_office;
  134.         return $this;
  135.     }
  136.     public function getCreationDate(): ?\DateTimeInterface
  137.     {
  138.         return $this->creation_date;
  139.     }
  140.     public function setCreationDate(\DateTimeInterface $creation_date): self
  141.     {
  142.         $this->creation_date $creation_date;
  143.         return $this;
  144.     }
  145.     public function getStatus(): ?string
  146.     {
  147.         return $this->status;
  148.     }
  149.     public function setStatus(string $status): self
  150.     {
  151.         $this->status $status;
  152.         return $this;
  153.     }
  154.     public function getModel(): ?string
  155.     {
  156.         return $this->model;
  157.     }
  158.     public function setModel(string $model): self
  159.     {
  160.         $this->model $model;
  161.         return $this;
  162.     }
  163.     public function getNumber(): ?string
  164.     {
  165.         return $this->number;
  166.     }
  167.     public function setNumber(string $number): self
  168.     {
  169.         $this->number $number;
  170.         return $this;
  171.     }
  172.     public function getEuringRingCode(): ?string
  173.     {
  174.         return $this->euring_ring_code;
  175.     }
  176.     public function setEuringRingCode(string $euring_ring_code): self
  177.     {
  178.         $this->euring_ring_code $euring_ring_code;
  179.         return $this;
  180.     }
  181.     public function getRegister(): ?Register
  182.     {
  183.         return $this->register;
  184.     }
  185.     public function setRegister(Register $register): self
  186.     {
  187.         // set the owning side of the relation if necessary
  188.         if ($register->getRing() !== $this) {
  189.             $register->setRing($this);
  190.         }
  191.         $this->register $register;
  192.         return $this;
  193.     }
  194.     public function getBatch(): ?RingBatch
  195.     {
  196.         return $this->batch;
  197.     }
  198.     public function setBatch(?RingBatch $batch): self
  199.     {
  200.         $this->batch $batch;
  201.         return $this;
  202.     }
  203. }