welcome back to dyb-tech

This commit is contained in:
Daniel Guzman
2024-05-18 02:28:01 +02:00
parent 9513cdba09
commit 9f30bc98c7
6149 changed files with 668407 additions and 0 deletions
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace DMD\LaLigaApi\Entity;
use DMD\LaLigaApi\Repository\CustomRoleRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CustomRoleRepository::class)]
#[ORM\HasLifecycleCallbacks]
class CustomRole
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $name = null;
#[ORM\ManyToOne(inversedBy: 'customRoles')]
private ?User $user = null;
#[ORM\Column(nullable: true)]
private ?\DateTimeImmutable $createdAt = null;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): static
{
$this->name = $name;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): static
{
$this->user = $user;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
#[ORM\PrePersist]
public function setCreatedAt(): static
{
$this->createdAt = new \DateTimeImmutable('now', new \DateTimeZone('Europe/Madrid'));
return $this;
}
}