src/Entity/Region.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity
  6.  * @ORM\Table(name="region")
  7.  */
  8. class Region
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\Column(type="string", length=100)
  13.      */
  14.     private $name;
  15.     /**
  16.      * @ORM\Column(type="string", length=20, nullable=true)
  17.      */
  18.     private $code;
  19.     /**
  20.      * @ORM\Column(type="string", length=100, nullable=true)
  21.      */
  22.     private $country 'Tunisie';
  23.     /**
  24.      * @ORM\Column(type="boolean")
  25.      */
  26.     private $isActive true;
  27.     public function getName(): ?string
  28.     {
  29.         return $this->name;
  30.     }
  31.     public function setName(string $name): self
  32.     {
  33.         $this->name $name;
  34.         return $this;
  35.     }
  36.     public function getCode(): ?string
  37.     {
  38.         return $this->code;
  39.     }
  40.     public function setCode(?string $code): self
  41.     {
  42.         $this->code $code;
  43.         return $this;
  44.     }
  45.     public function getCountry(): ?string
  46.     {
  47.         return $this->country;
  48.     }
  49.     public function setCountry(?string $country): self
  50.     {
  51.         $this->country $country;
  52.         return $this;
  53.     }
  54.     public function getIsActive(): bool
  55.     {
  56.         return $this->isActive;
  57.     }
  58.     public function setIsActive(bool $isActive): self
  59.     {
  60.         $this->isActive $isActive;
  61.         return $this;
  62.     }
  63.     /**
  64.      * Pour que Symfony Form affiche le nom de la rĂ©gion automatiquement
  65.      */
  66.     public function __toString(): string
  67.     {
  68.         return $this->name ?? '';
  69.     }
  70. }