mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-17 07:44:24 +00:00
114 lines
2.0 KiB
PHP
114 lines
2.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Chill\MainBundle\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Serializer\Annotation\Context;
|
|
use Symfony\Component\Serializer\Annotation\Groups;
|
|
|
|
/**
|
|
* Country.
|
|
*
|
|
* @ORM\Entity
|
|
* @ORM\Table(name="country")
|
|
* @ORM\Cache(usage="READ_ONLY", region="country_cache_region")
|
|
* @ORM\HasLifecycleCallbacks
|
|
*/
|
|
class Country
|
|
{
|
|
/**
|
|
* @ORM\Column(type="string", length=3)
|
|
* @groups({"read", "docgen:read"})
|
|
* @Context({"is-translatable": true}, groups={"docgen:read"})
|
|
*/
|
|
private string $countryCode = '';
|
|
|
|
/**
|
|
* @var int
|
|
*
|
|
* @ORM\Id
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
* @groups({"read", "docgen:read"})
|
|
*/
|
|
private ?int $id = null;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(type="json")
|
|
* @groups({"read", "docgen:read"})
|
|
* @Context({"is-translatable": true}, groups={"docgen:read"})
|
|
*/
|
|
private $name;
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function __toString()
|
|
{
|
|
return $this->getName();
|
|
}
|
|
|
|
/**
|
|
* @return the string
|
|
*/
|
|
public function getCountryCode()
|
|
{
|
|
return $this->countryCode;
|
|
}
|
|
|
|
/**
|
|
* Get id.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
/**
|
|
* Get name.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getName()
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
/**
|
|
* @param string $countryCode
|
|
*/
|
|
public function setCountryCode($countryCode)
|
|
{
|
|
$this->countryCode = $countryCode;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Set name.
|
|
*
|
|
* @param string $name
|
|
*
|
|
* @return Country
|
|
*/
|
|
public function setName($name)
|
|
{
|
|
$this->name = $name;
|
|
|
|
return $this;
|
|
}
|
|
}
|