src/Entity/Prescription.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\PrescriptionRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassPrescriptionRepository::class)]
  10. #[ApiResource]
  11. class Prescription
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $code null;
  19.     #[ORM\ManyToOne(inversedBy'prescriptions')]
  20.     private ?User $patient null;
  21.     #[ORM\ManyToOne(inversedBy'prescriptions')]
  22.     private ?User $doctor null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $medecine null;
  25.     #[ORM\Column(length255)]
  26.     private ?string $unit null;
  27.     #[ORM\Column(length255)]
  28.     private ?string $frequency null;
  29.     #[ORM\Column(typeTypes::DATETIME_IMMUTABLE)]
  30.     private ?\DateTimeInterface $presciption_at null;
  31.     #[ORM\Column]
  32.     private ?float $quantity null;
  33.     #[ORM\Column]
  34.     private ?int $during null;
  35.     #[ORM\Column]
  36.     private ?\DateTimeImmutable $created_at null;
  37.     #[ORM\Column(nullabletrue)]
  38.     private ?\DateTimeImmutable $updated_at null;
  39.     public function __construct()
  40.     {
  41.         $this->presciption_at = new \DateTimeImmutable();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getCode(): ?string
  48.     {
  49.         return $this->code;
  50.     }
  51.     public function setCode(string $code): static
  52.     {
  53.         $this->code $code;
  54.         return $this;
  55.     }
  56.     public function getPatient(): ?User
  57.     {
  58.         return $this->patient;
  59.     }
  60.     public function setPatient(?User $patient): static
  61.     {
  62.         $this->patient $patient;
  63.         return $this;
  64.     }
  65.     public function getDoctor(): ?User
  66.     {
  67.         return $this->doctor;
  68.     }
  69.     public function setDoctor(?User $doctor): static
  70.     {
  71.         $this->doctor $doctor;
  72.         return $this;
  73.     }
  74.     public function getMedecine(): ?string
  75.     {
  76.         return $this->medecine;
  77.     }
  78.     public function setMedecine(string $medecine): static
  79.     {
  80.         $this->medecine $medecine;
  81.         return $this;
  82.     }
  83.     public function getUnit(): ?string
  84.     {
  85.         return $this->unit;
  86.     }
  87.     public function setUnit(string $unit): static
  88.     {
  89.         $this->unit $unit;
  90.         return $this;
  91.     }
  92.     public function getFrequency(): ?string
  93.     {
  94.         return $this->frequency;
  95.     }
  96.     public function setFrequency(string $frequency): static
  97.     {
  98.         $this->frequency $frequency;
  99.         return $this;
  100.     }
  101.     public function getPresciptionAt(): ?\DateTimeInterface
  102.     {
  103.         return $this->presciption_at;
  104.     }
  105.     public function setPresciptionAt(\DateTimeInterface $presciption_at): static
  106.     {
  107.         $this->presciption_at $presciption_at;
  108.         return $this;
  109.     }
  110.     public function getQuantity(): ?float
  111.     {
  112.         return $this->quantity;
  113.     }
  114.     public function setQuantity(float $quantity): static
  115.     {
  116.         $this->quantity $quantity;
  117.         return $this;
  118.     }
  119.     public function getDuring(): ?int
  120.     {
  121.         return $this->during;
  122.     }
  123.     public function setDuring(int $during): static
  124.     {
  125.         $this->during $during;
  126.         return $this;
  127.     }
  128.     public function getCreatedAt(): ?\DateTimeImmutable
  129.     {
  130.         return $this->created_at;
  131.     }
  132.     public function setCreatedAt(\DateTimeImmutable $created_at): static
  133.     {
  134.         $this->created_at $created_at;
  135.         return $this;
  136.     }
  137.     public function getUpdatedAt(): ?\DateTimeImmutable
  138.     {
  139.         return $this->updated_at;
  140.     }
  141.     public function setUpdatedAt(?\DateTimeImmutable $updated_at): static
  142.     {
  143.         $this->updated_at $updated_at;
  144.         return $this;
  145.     }
  146. }