mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-04 05:44:58 +00:00
add model + form to handle alt names
This commit is contained in:
@@ -42,6 +42,12 @@ class Person implements HasCenterInterface {
|
||||
|
||||
/** @var string The person's last name */
|
||||
private $lastName;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var \Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
private $altNames;
|
||||
|
||||
/** @var \DateTime The person's birthdate */
|
||||
private $birthdate; //to change in birthdate
|
||||
@@ -123,6 +129,7 @@ class Person implements HasCenterInterface {
|
||||
$this->accompanyingPeriods = new ArrayCollection();
|
||||
$this->spokenLanguages = new ArrayCollection();
|
||||
$this->addresses = new ArrayCollection();
|
||||
$this->altNames = new ArrayCollection();
|
||||
|
||||
if ($opening === null) {
|
||||
$opening = new \DateTime();
|
||||
@@ -324,7 +331,39 @@ class Person implements HasCenterInterface {
|
||||
{
|
||||
return $this->lastName;
|
||||
}
|
||||
|
||||
public function getAltNames(): \Doctrine\Common\Collections\Collection
|
||||
{
|
||||
return $this->altNames;
|
||||
}
|
||||
|
||||
public function setAltNames(\Doctrine\Common\Collections\Collection $altNames)
|
||||
{
|
||||
$this->altNames = $altNames;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addAltName(PersonAltName $altName)
|
||||
{
|
||||
if (FALSE === $this->altNames->contains($altName)) {
|
||||
$this->altNames->add($altName);
|
||||
$altName->setPerson($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeAltName(PersonAltName $altName)
|
||||
{
|
||||
if ($this->altNames->contains($altName)) {
|
||||
$altName->setPerson(null);
|
||||
$this->altNames->removeElement($altName);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set birthdate
|
||||
*
|
||||
|
Reference in New Issue
Block a user