src/Entity/Heading.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\TimeStampable;
  4. use App\Repository\HeadingRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. #[ORM\Entity(repositoryClass: HeadingRepository::class)]
  8. #[ORM\HasLifecycleCallbacks]
  9. class Heading
  10. {
  11.     use TimeStampable;
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     #[Groups(['entity:write'])]
  16.     private ?int $id = null;
  17.     #[ORM\Column(length: 255)]
  18.     #[Groups(['entity:write'])]
  19.     private ?string $label = null;
  20.     #[ORM\Column(length: 15)]
  21.     #[Groups(['entity:write'])]
  22.     private ?string $code = null;
  23.     #[ORM\ManyToOne]
  24.     private ?User $createdBy = null;
  25.     #[ORM\ManyToOne]
  26.     private ?User $updatedBy = null;
  27.     public function __construct() {
  28.         $this->createdAt = new \DateTimeImmutable();
  29.         $this->isEnabled = true;
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getLabel(): ?string
  36.     {
  37.         return $this->label;
  38.     }
  39.     public function setLabel(string $label): self
  40.     {
  41.         $this->label = $label;
  42.         return $this;
  43.     }
  44.     public function getCode(): ?string
  45.     {
  46.         return $this->code;
  47.     }
  48.     public function setCode(string $code): self
  49.     {
  50.         $this->code = $code;
  51.         return $this;
  52.     }
  53.     public function getCreatedBy(): ?User
  54.     {
  55.         return $this->createdBy;
  56.     }
  57.     public function setCreatedBy(?User $createdBy): self
  58.     {
  59.         $this->createdBy = $createdBy;
  60.         return $this;
  61.     }
  62.     public function getUpdatedBy(): ?User
  63.     {
  64.         return $this->updatedBy;
  65.     }
  66.     public function setUpdatedBy(?User $updatedBy): self
  67.     {
  68.         $this->updatedBy = $updatedBy;
  69.         return $this;
  70.     }
  71.  
  72. }