src/Entity/AvailabilityTracker.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AvailabilityTrackerRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassAvailabilityTrackerRepository::class)]
  6. class AvailabilityTracker
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\ManyToOne(targetEntityProducts::class, inversedBy'availabilityTrackers')]
  13.     private $product;
  14.     #[ORM\ManyToOne(targetEntityClinics::class, inversedBy'availabilityTrackers')]
  15.     private $clinic;
  16.     #[ORM\Column(type'boolean')]
  17.     private $isSent;
  18.     #[ORM\Column(type'datetime')]
  19.     private $modified;
  20.     #[ORM\Column(type'datetime')]
  21.     private $created;
  22.     #[ORM\ManyToOne(targetEntityDistributors::class, inversedBy'availabilityTrackers')]
  23.     private $distributor;
  24.     #[ORM\ManyToOne(targetEntityClinicCommunicationMethods::class, inversedBy'availabilityTrackers')]
  25.     private $communication;
  26.     #[ORM\OneToOne(targetEntityNotifications::class, mappedBy'availabilityTracker'cascade: ['persist''remove'])]
  27.     private $notifications;
  28.     public function __construct()
  29.     {
  30.         $this->setCreated(new \DateTime());
  31.         if ($this->getModified() == null) {
  32.             $this->setModified(new \DateTime());
  33.         }
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getProduct(): ?Products
  40.     {
  41.         return $this->product;
  42.     }
  43.     public function setProduct(?Products $product): self
  44.     {
  45.         $this->product $product;
  46.         return $this;
  47.     }
  48.     public function getClinic(): ?Clinics
  49.     {
  50.         return $this->clinic;
  51.     }
  52.     public function setClinic(?Clinics $clinic): self
  53.     {
  54.         $this->clinic $clinic;
  55.         return $this;
  56.     }
  57.     public function getIsSent(): ?bool
  58.     {
  59.         return $this->isSent;
  60.     }
  61.     public function setIsSent(bool $isSent): self
  62.     {
  63.         $this->isSent $isSent;
  64.         return $this;
  65.     }
  66.     public function getModified(): ?\DateTimeInterface
  67.     {
  68.         return $this->modified;
  69.     }
  70.     public function setModified(\DateTimeInterface $modified): self
  71.     {
  72.         $this->modified $modified;
  73.         return $this;
  74.     }
  75.     public function getCreated(): ?\DateTimeInterface
  76.     {
  77.         return $this->created;
  78.     }
  79.     public function setCreated(\DateTimeInterface $created): self
  80.     {
  81.         $this->created $created;
  82.         return $this;
  83.     }
  84.     public function getDistributor(): ?Distributors
  85.     {
  86.         return $this->distributor;
  87.     }
  88.     public function setDistributor(?Distributors $distributor): self
  89.     {
  90.         $this->distributor $distributor;
  91.         return $this;
  92.     }
  93.     public function getCommunication(): ?ClinicCommunicationMethods
  94.     {
  95.         return $this->communication;
  96.     }
  97.     public function setCommunication(?ClinicCommunicationMethods $communication): self
  98.     {
  99.         $this->communication $communication;
  100.         return $this;
  101.     }
  102.     public function getNotifications(): ?Notifications
  103.     {
  104.         return $this->notifications;
  105.     }
  106.     public function setNotifications(?Notifications $notifications): self
  107.     {
  108.         // unset the owning side of the relation if necessary
  109.         if ($notifications === null && $this->notifications !== null) {
  110.             $this->notifications->setAvailabilityTracker(null);
  111.         }
  112.         // set the owning side of the relation if necessary
  113.         if ($notifications !== null && $notifications->getAvailabilityTracker() !== $this) {
  114.             $notifications->setAvailabilityTracker($this);
  115.         }
  116.         $this->notifications $notifications;
  117.         return $this;
  118.     }
  119. }