2015-04-07 19:11:26 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Pays
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var integer $id Identifiant du pays
|
|
|
|
*/
|
|
|
|
protected $id;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string $nom Nom du pays
|
|
|
|
*/
|
|
|
|
protected $nom;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string $symbole Symbole du pays
|
|
|
|
*/
|
|
|
|
protected $symbole;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $nom Nom du pays
|
|
|
|
* @param string $symbole Symbole du pays
|
|
|
|
*/
|
|
|
|
public function __construct($nom, $symbole = null)
|
|
|
|
{
|
|
|
|
$this->setNom($nom);
|
|
|
|
|
|
|
|
if (null !== $symbole) {
|
|
|
|
$this->setSymbole($symbole);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-04-07 19:22:42 +02:00
|
|
|
* @param integer|null $id
|
2015-04-07 19:11:26 +02:00
|
|
|
* @return Pays
|
|
|
|
*/
|
|
|
|
public function setId($id)
|
|
|
|
{
|
|
|
|
$this->id = (int) $id;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return integer|null
|
|
|
|
*/
|
|
|
|
public function getId()
|
|
|
|
{
|
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $nom
|
|
|
|
* @return Pays
|
|
|
|
*/
|
|
|
|
public function setNom($nom)
|
|
|
|
{
|
|
|
|
if ('' === trim((string) $nom)) {
|
|
|
|
throw new InvalidArgumentException('Le nom ne peut pas être vide.');
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->nom = $nom;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string|null
|
|
|
|
*/
|
|
|
|
public function getNom()
|
|
|
|
{
|
|
|
|
return $this->nom;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $symbole
|
|
|
|
* @return Pays
|
|
|
|
*/
|
|
|
|
public function setSymbole($symbole)
|
|
|
|
{
|
|
|
|
if ('' === trim((string) $symbole)) {
|
|
|
|
throw new InvalidArgumentException('Le symbole ne peut pas être vide.');
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->symbole = $symbole;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string|null
|
|
|
|
*/
|
|
|
|
public function getSymbole()
|
|
|
|
{
|
|
|
|
return $this->symbole;
|
|
|
|
}
|
|
|
|
}
|