src/Entity/Region.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RegionRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassRegionRepository::class)]
  7. class Region
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     //#[ORM\Column(type: 'text', nullable:true, unique: true)]
  14.     #[ORM\Column(type'string'length255nullable:falseuniquetrue)]
  15.     private $nombre;
  16.     #[ORM\Column(type"integer"nullabletrue)]
  17.     private ?int $orden null;
  18.     #[ORM\ManyToMany(targetEntity"App\Entity\User"mappedBy'regiones')]
  19.     private $usuarios;
  20.     public function __construct()
  21.     {
  22.         $this->usuarios = new ArrayCollection();
  23.     }
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getNombre(): ?string
  29.     {
  30.         return $this->nombre;
  31.     }
  32.     public function setNombre(?string $nombre): self
  33.     {
  34.         $this->nombre $nombre;
  35.         return $this;
  36.     }
  37.     public function getOrden(): ?int
  38.     {
  39.         return $this->orden;
  40.     }
  41.     public function setOrden(int $orden): self
  42.     {
  43.         $this->orden $orden;
  44.         return $this;
  45.     }
  46.     public function __toString(){
  47.         return $this->getNombre();
  48.     }
  49.     public function getUsuarios()
  50.     {
  51.         return $this->usuarios;
  52.     }
  53. }