src/Entity/Period.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PeriodRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClass: PeriodRepository::class)]
  7. class Period
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id = null;
  13.     #[ORM\Column(type: Types::DATETIME_MUTABLE)]
  14.     private ?\DateTimeInterface $startDate = null;
  15.     #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
  16.     private ?\DateTimeInterface $endDate = null;
  17.     #[ORM\Column(length: 15)]
  18.     private ?string $code = null;
  19.     #[ORM\ManyToOne]
  20.     private ?User $createdBy = null;
  21.     #[ORM\ManyToOne]
  22.     private ?User $updatedBy = null;
  23.     #[ORM\Column]
  24.     private ?\DateTimeImmutable $createdAt = null;
  25.     #[ORM\Column(nullable: true)]
  26.     private ?\DateTimeImmutable $updatedAt = null;
  27.     public function __construct()
  28.     {
  29.         $this->createdAt = new \DateTimeImmutable();
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getStartDate(): ?\DateTimeInterface
  36.     {
  37.         return $this->startDate;
  38.     }
  39.     public function setStartDate(\DateTimeInterface $startDate): self
  40.     {
  41.         $this->startDate = $startDate;
  42.         return $this;
  43.     }
  44.     public function getEndDate(): ?\DateTimeInterface
  45.     {
  46.         return $this->endDate;
  47.     }
  48.     public function setEndDate(?\DateTimeInterface $endDate): self
  49.     {
  50.         $this->endDate = $endDate;
  51.         return $this;
  52.     }
  53.     public function getCode(): ?string
  54.     {
  55.         return $this->code;
  56.     }
  57.     public function setCode(string $code): self
  58.     {
  59.         $this->code = $code;
  60.         return $this;
  61.     }
  62.     public function getCreatedBy(): ?User
  63.     {
  64.         return $this->createdBy;
  65.     }
  66.     public function setCreatedBy(?User $createdBy): self
  67.     {
  68.         $this->createdBy = $createdBy;
  69.         return $this;
  70.     }
  71.     public function getUpdatedBy(): ?User
  72.     {
  73.         return $this->updatedBy;
  74.     }
  75.     public function setUpdatedBy(?User $updatedBy): self
  76.     {
  77.         $this->updatedBy = $updatedBy;
  78.         return $this;
  79.     }
  80.     public function getCreatedAt(): ?\DateTimeImmutable
  81.     {
  82.         return $this->createdAt;
  83.     }
  84.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  85.     {
  86.         $this->createdAt = $createdAt;
  87.         return $this;
  88.     }
  89.     public function getUpdatedAt(): ?\DateTimeImmutable
  90.     {
  91.         return $this->updatedAt;
  92.     }
  93.     public function setUpdatedAt(?\DateTimeImmutable $updatedAt): self
  94.     {
  95.         $this->updatedAt = $updatedAt;
  96.         return $this;
  97.     }
  98. }