src/Entity/Roles.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RolesRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. /**
  8.  * @ORM\Entity(repositoryClass=RolesRepository::class)
  9.  *  @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(columns={"name"})})
  10.  *  @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(columns={"code"})})
  11.  */
  12. class Roles
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255, unique=true)
  22.      * @Assert\NotBlank(message="Le nom du rôle est obligatoire")
  23.      */
  24.     private $name;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, unique=true)
  27.      * @Assert\NotBlank(message="Le code du rôle est obligatoire")
  28.      */
  29.     private $code;
  30.     /**
  31.      * @ORM\Column(type="boolean")
  32.      */
  33.     private $status true;
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  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.     public function getCode(): ?string
  49.     {
  50.         return $this->code;
  51.     }
  52.     public function setCode(string $code): self
  53.     {
  54.         $this->code $code;
  55.         return $this;
  56.     }
  57.     public function isStatus(): ?bool
  58.     {
  59.         return $this->status;
  60.     }
  61.     public function setStatus(bool $status): self
  62.     {
  63.         $this->status $status;
  64.         return $this;
  65.     }
  66.     function __toString()
  67.     {
  68.         return $this->getName();
  69.     }
  70. }