<?php
namespace App\Entity;
use App\Entity\Traits\TimeStampable;
use App\Repository\HeadingRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity(repositoryClass: HeadingRepository::class)]
#[ORM\HasLifecycleCallbacks]
class Heading
{
use TimeStampable;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
#[Groups(['entity:write'])]
private ?int $id = null;
#[ORM\Column(length: 255)]
#[Groups(['entity:write'])]
private ?string $label = null;
#[ORM\Column(length: 15)]
#[Groups(['entity:write'])]
private ?string $code = null;
#[ORM\ManyToOne]
private ?User $createdBy = null;
#[ORM\ManyToOne]
private ?User $updatedBy = null;
public function __construct() {
$this->createdAt = new \DateTimeImmutable();
$this->isEnabled = true;
}
public function getId(): ?int
{
return $this->id;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
public function getCreatedBy(): ?User
{
return $this->createdBy;
}
public function setCreatedBy(?User $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
public function getUpdatedBy(): ?User
{
return $this->updatedBy;
}
public function setUpdatedBy(?User $updatedBy): self
{
$this->updatedBy = $updatedBy;
return $this;
}
}