<?phpnamespace App\Entity;use App\Annotation\Exportable;use App\Annotation\ExportableEntity;use App\Repository\UserExtensionRepository;use Doctrine\ORM\Mapping as ORM;use Gedmo\Mapping\Annotation as Gedmo;use Symfony\Component\Validator\Constraints as Assert;use DateTime;/** * @ORM\Entity(repositoryClass=UserExtensionRepository::class) * * @ORM\HasLifecycleCallbacks * @ExportableEntity */class UserExtension{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private ?int $id = null; /** * @ORM\ManyToOne(targetEntity=User::class, inversedBy="extensions") * @ORM\JoinColumn(nullable=false) * * @Assert\NotNull */ private ?User $user = null; /** * @ORM\Column(type="string", length=64) * * @Assert\NotBlank * @Assert\Length( * min = 3, * max = 64, * ) * * @Exportable("slug") */ private ?string $slug = null; /** * @ORM\Column(type="text") * * @Assert\NotBlank * * @Exportable("value") */ private ?string $value = null; /** * @Gedmo\Timestampable(on="create") * @ORM\Column(type="datetime", nullable=true) */ private ?DateTime $createdAt = null; public function getSerialized(): string { return $this->getSlug() . ':' . $this->getValue(); } public function getId(): ?int { return $this->id; } public function getUser(): ?User { return $this->user; } public function setUser(?User $user): self { $this->user = $user; return $this; } public function getSlug(): ?string { return $this->slug; } public function setSlug(string $slug): self { $this->slug = $slug; return $this; } public function getValue(): ?string { return $this->value; } public function setValue(string $value): self { $this->value = $value; return $this; } public function getCreatedAt(): ?DateTime { return $this->createdAt; } public function setCreatedAt(?DateTime $createdAt): self { $this->createdAt = $createdAt; return $this; }}