src/Entity/TipoUsuario.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TipoUsuarioRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TipoUsuarioRepository::class)
  9.  */
  10. class TipoUsuario
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $nombre;
  22.     /**
  23.      * @ORM\Column(type="boolean")
  24.      */
  25.     private $estado;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=User::class, mappedBy="tipousuario")
  28.      */
  29.     private $users;
  30.     /**
  31.      * @ORM\Column(type="string", length=50)
  32.      */
  33.     private $ip_crea;
  34.     /**
  35.      * @ORM\Column(type="string", length=50)
  36.      */
  37.     private $ip_modifica;
  38.     /**
  39.      * @ORM\Column(type="integer")
  40.      */
  41.     private $user_crea;
  42.     /**
  43.      * @ORM\Column(type="integer")
  44.      */
  45.     private $user_modifica;
  46.     /**
  47.      * @ORM\Column(type="datetime")
  48.      */
  49.     private $created_at;
  50.     /**
  51.      * @ORM\Column(type="datetime")
  52.      */
  53.     private $updated_at;
  54.     
  55.     /**
  56.      * @ORM\Column(type="text", nullable=true)
  57.      */
  58.     private $roles;
  59.     public function __construct()
  60.     {
  61.         $this->users = new ArrayCollection();
  62.     }
  63.     public function getId(): ?int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getNombre(): ?string
  68.     {
  69.         return $this->nombre;
  70.     }
  71.     public function setNombre(string $nombre): self
  72.     {
  73.         $this->nombre $nombre;
  74.         return $this;
  75.     }
  76.     public function getEstado(): ?bool
  77.     {
  78.         return $this->estado;
  79.     }
  80.     public function setEstado(bool $estado): self
  81.     {
  82.         $this->estado $estado;
  83.         return $this;
  84.     }
  85.     /**
  86.      * @return Collection|User[]
  87.      */
  88.     public function getUsers(): Collection
  89.     {
  90.         return $this->users;
  91.     }
  92.     public function addUser(User $user): self
  93.     {
  94.         if (!$this->users->contains($user)) {
  95.             $this->users[] = $user;
  96.             $user->setTipousuario($this);
  97.         }
  98.         return $this;
  99.     }
  100.     public function removeUser(User $user): self
  101.     {
  102.         if ($this->users->contains($user)) {
  103.             $this->users->removeElement($user);
  104.             // set the owning side to null (unless already changed)
  105.             if ($user->getTipousuario() === $this) {
  106.                 $user->setTipousuario(null);
  107.             }
  108.         }
  109.         return $this;
  110.     }
  111.     /**
  112.      * Generates the magic method
  113.      *
  114.      */
  115.     public function __toString(){
  116.         // to show the name of the Category in the select
  117.         return $this->nombre;
  118.         // to show the id of the Category in the select
  119.         // return $this->id;
  120.     }
  121.     public function getIpCrea(): ?string
  122.     {
  123.         return $this->ip_crea;
  124.     }
  125.     public function setIpCrea(string $ip_crea): self
  126.     {
  127.         $this->ip_crea $ip_crea;
  128.         return $this;
  129.     }
  130.     public function getIpModifica(): ?string
  131.     {
  132.         return $this->ip_modifica;
  133.     }
  134.     public function setIpModifica(string $ip_modifica): self
  135.     {
  136.         $this->ip_modifica $ip_modifica;
  137.         return $this;
  138.     }
  139.     public function getUserCrea(): ?int
  140.     {
  141.         return $this->user_crea;
  142.     }
  143.     public function setUserCrea(int $user_crea): self
  144.     {
  145.         $this->user_crea $user_crea;
  146.         return $this;
  147.     }
  148.     public function getUserModifica(): ?int
  149.     {
  150.         return $this->user_modifica;
  151.     }
  152.     public function setUserModifica(int $user_modifica): self
  153.     {
  154.         $this->user_modifica $user_modifica;
  155.         return $this;
  156.     }
  157.     public function getCreatedAt(): ?\DateTimeInterface
  158.     {
  159.         return $this->created_at;
  160.     }
  161.     public function setCreatedAt(\DateTimeInterface $created_at): self
  162.     {
  163.         $this->created_at $created_at;
  164.         return $this;
  165.     }
  166.     public function getUpdatedAt(): ?\DateTimeInterface
  167.     {
  168.         return $this->updated_at;
  169.     }
  170.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  171.     {
  172.         $this->updated_at $updated_at;
  173.         return $this;
  174.     }
  175.     
  176.     public function getRoles(): ?string
  177.     {
  178.         return $this->roles;
  179.     }
  180.     public function setRoles(?string $roles): self
  181.     {
  182.         $this->roles $roles;
  183.         return $this;
  184.     }
  185. }