src/Entity/Source.php line 10

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