<?php
namespace App\Entity;
use App\Repository\CountryRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CountryRepository::class)]
class Country implements \JsonSerializable
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private $id;
#[ORM\Column(length: 300)]
private $value;
#[ORM\Column(type: 'boolean',nullable:true, options: ['default' => true])]
private $state = true;
public function jsonSerialize()
{
return [
'id' => $this->getId(),
'value' => $this->getValue(),
];
}
public function getId(): ?int
{
return $this->id;
}
public function getValue(): ?string
{
return $this->value;
}
public function setValue(string $value): static
{
$this->value = $value;
return $this;
}
public function getState()
{
return $this->state;
}
public function setState($state): self
{
$this->state = $state;
return $this;
}
public function getStringState()
{
if($this->getState()){
return "Activé";
};
return "Bloqué";
}
public function isState(): ?bool
{
return $this->state;
}
}