src/Entity/Role.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RoleRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=RoleRepository::class)
  7.  * @ORM\Table(name="t_role")
  8.  */
  9. class Role
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue(strategy="IDENTITY")
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="roles")
  19.      * @ORM\JoinColumn(nullable=false)
  20.      */
  21.     private $users;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $name;
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getUsers(): ?User
  31.     {
  32.         return $this->users;
  33.     }
  34.     public function setUsers(?User $users): self
  35.     {
  36.         $this->users $users;
  37.         return $this;
  38.     }
  39.     public function getName(): ?string
  40.     {
  41.         return $this->name;
  42.     }
  43.     public function setName(string $name): self
  44.     {
  45.         $this->name $name;
  46.         return $this;
  47.     }
  48. }