<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="region")
*/
class Region
{
/**
* @ORM\Id
* @ORM\Column(type="string", length=100)
*/
private $name;
/**
* @ORM\Column(type="string", length=20, nullable=true)
*/
private $code;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $country = 'Tunisie';
/**
* @ORM\Column(type="boolean")
*/
private $isActive = true;
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(?string $code): self
{
$this->code = $code;
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(?string $country): self
{
$this->country = $country;
return $this;
}
public function getIsActive(): bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
/**
* Pour que Symfony Form affiche le nom de la région automatiquement
*/
public function __toString(): string
{
return $this->name ?? '';
}
}