<?phpnamespace App\Entity;use App\Repository\SecRolRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: SecRolRepository::class)]class SecRol{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 100)] private ?string $nombre = null; #[ORM\Column(length: 255, nullable: true)] private ?string $descripcion = null; #[ORM\ManyToMany(targetEntity: SecAccion::class, inversedBy: 'rol')] private Collection $accion; #[ORM\ManyToMany(targetEntity: SecUser::class, inversedBy: 'secRol')] private Collection $userId; #[ORM\Column(type: Types::DATETIME_MUTABLE)] private ?\DateTimeInterface $createAt = null; #[ORM\Column(length: 50)] private ?string $createUser = null; #[ORM\Column(type: Types::DATETIME_MUTABLE)] private ?\DateTimeInterface $updateAt = null; #[ORM\Column(length: 50)] private ?string $updateUser = null; public function __construct() { $this->accion = new ArrayCollection(); $this->userId = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getNombre(): ?string { return $this->nombre; } public function setNombre(string $nombre): static { $this->nombre = $nombre; return $this; } public function getDescripcion(): ?string { return $this->descripcion; } public function setDescripcion(?string $descripcion): static { $this->descripcion = $descripcion; return $this; } /** * @return Collection<int, SecAccion> */ public function getAccion(): Collection { return $this->accion; } public function addAccion(SecAccion $secAccion): static { if (!$this->accion->contains($secAccion)) { $this->accion->add($secAccion); } return $this; } public function removeAccion(SecAccion $secAccion): static { $this->accion->removeElement($secAccion); return $this; } /** * @return Collection<int, SecUser> */ public function getUserId(): Collection { return $this->userId; } public function addUserId(SecUser $userId): static { if (!$this->userId->contains($userId)) { $this->userId->add($userId); } return $this; } public function removeUserId(SecUser $userId): static { $this->userId->removeElement($userId); return $this; } public function getCreateAt(): ?\DateTimeInterface { return $this->createAt; } public function setCreateAt(\DateTimeInterface $createAt): static { $this->createAt = $createAt; return $this; } public function getCreateUser(): ?string { return $this->createUser; } public function setCreateUser(string $createUser): static { $this->createUser = $createUser; return $this; } public function getUpdateAt(): ?\DateTimeInterface { return $this->updateAt; } public function setUpdateAt(\DateTimeInterface $updateAt): static { $this->updateAt = $updateAt; return $this; } public function getUpdateUser(): ?string { return $this->updateUser; } public function setUpdateUser(string $updateUser): static { $this->updateUser = $updateUser; return $this; } }