src/Entity/ProductRetail.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProductRetailRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassProductRetailRepository::class)]
  6. class ProductRetail
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\ManyToOne(targetEntityProducts::class, inversedBy'productRetails')]
  13.     private $product;
  14.     #[ORM\ManyToOne(targetEntityClinics::class, inversedBy'productRetails')]
  15.     private $clinic;
  16.     #[ORM\Column(type'datetime')]
  17.     private $modified;
  18.     #[ORM\Column(type'datetime')]
  19.     private $created;
  20.     public function __construct()
  21.     {
  22.         $this->setModified(new \DateTime());
  23.         if ($this->getCreated() == null) {
  24.             $this->setCreated(new \DateTime());
  25.         }
  26.     }
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getProduct(): ?Products
  32.     {
  33.         return $this->product;
  34.     }
  35.     public function setProduct(?Products $product): self
  36.     {
  37.         $this->product $product;
  38.         return $this;
  39.     }
  40.     public function getClinic(): ?Clinics
  41.     {
  42.         return $this->clinic;
  43.     }
  44.     public function setClinic(?Clinics $clinic): self
  45.     {
  46.         $this->clinic $clinic;
  47.         return $this;
  48.     }
  49.     public function getModified(): ?\DateTimeInterface
  50.     {
  51.         return $this->modified;
  52.     }
  53.     public function setModified(\DateTimeInterface $modified): self
  54.     {
  55.         $this->modified $modified;
  56.         return $this;
  57.     }
  58.     public function getCreated(): ?\DateTimeInterface
  59.     {
  60.         return $this->created;
  61.     }
  62.     public function setCreated(\DateTimeInterface $created): self
  63.     {
  64.         $this->created $created;
  65.         return $this;
  66.     }
  67. }