src/Entity/SecRol.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SecRolRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassSecRolRepository::class)]
  9. class SecRol
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length100)]
  16.     private ?string $nombre null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $descripcion null;
  19.     #[ORM\ManyToMany(targetEntitySecAccion::class, inversedBy'rol')]
  20.     private Collection $accion;
  21.     #[ORM\ManyToMany(targetEntitySecUser::class, inversedBy'secRol')]
  22.     private Collection $userId;
  23.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  24.     private ?\DateTimeInterface $createAt null;
  25.     #[ORM\Column(length50)]
  26.     private ?string $createUser null;
  27.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  28.     private ?\DateTimeInterface $updateAt null;
  29.     #[ORM\Column(length50)]
  30.     private ?string $updateUser null;
  31.     public function __construct()
  32.     {
  33.         $this->accion = new ArrayCollection();
  34.         $this->userId = new ArrayCollection();
  35.     }
  36.    
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getNombre(): ?string
  42.     {
  43.         return $this->nombre;
  44.     }
  45.     public function setNombre(string $nombre): static
  46.     {
  47.         $this->nombre $nombre;
  48.         return $this;
  49.     }
  50.     public function getDescripcion(): ?string
  51.     {
  52.         return $this->descripcion;
  53.     }
  54.     public function setDescripcion(?string $descripcion): static
  55.     {
  56.         $this->descripcion $descripcion;
  57.         return $this;
  58.     }
  59.     /**
  60.      * @return Collection<int, SecAccion>
  61.      */
  62.     public function getAccion(): Collection
  63.     {
  64.         return $this->accion;
  65.     }
  66.     public function addAccion(SecAccion $secAccion): static
  67.     {
  68.         if (!$this->accion->contains($secAccion)) {
  69.             $this->accion->add($secAccion);
  70.         }
  71.         return $this;
  72.     }
  73.     public function removeAccion(SecAccion $secAccion): static
  74.     {
  75.         $this->accion->removeElement($secAccion);
  76.         return $this;
  77.     }
  78.     /**
  79.      * @return Collection<int, SecUser>
  80.      */
  81.     public function getUserId(): Collection
  82.     {
  83.         return $this->userId;
  84.     }
  85.     public function addUserId(SecUser $userId): static
  86.     {
  87.         if (!$this->userId->contains($userId)) {
  88.             $this->userId->add($userId);
  89.         }
  90.         return $this;
  91.     }
  92.     public function removeUserId(SecUser $userId): static
  93.     {
  94.         $this->userId->removeElement($userId);
  95.         return $this;
  96.     }
  97.     public function getCreateAt(): ?\DateTimeInterface
  98.     {
  99.         return $this->createAt;
  100.     }
  101.     public function setCreateAt(\DateTimeInterface $createAt): static
  102.     {
  103.         $this->createAt $createAt;
  104.         return $this;
  105.     }
  106.     public function getCreateUser(): ?string
  107.     {
  108.         return $this->createUser;
  109.     }
  110.     public function setCreateUser(string $createUser): static
  111.     {
  112.         $this->createUser $createUser;
  113.         return $this;
  114.     }
  115.     public function getUpdateAt(): ?\DateTimeInterface
  116.     {
  117.         return $this->updateAt;
  118.     }
  119.     public function setUpdateAt(\DateTimeInterface $updateAt): static
  120.     {
  121.         $this->updateAt $updateAt;
  122.         return $this;
  123.     }
  124.     public function getUpdateUser(): ?string
  125.     {
  126.         return $this->updateUser;
  127.     }
  128.     public function setUpdateUser(string $updateUser): static
  129.     {
  130.         $this->updateUser $updateUser;
  131.         return $this;
  132.     }
  133.   
  134. }