mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Features/new phones
This commit is contained in:
@@ -72,7 +72,7 @@ class Person implements HasCenterInterface
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
private $lastName;
|
||||
|
||||
|
||||
/**
|
||||
* @var Collection
|
||||
*
|
||||
@@ -177,6 +177,18 @@ class Person implements HasCenterInterface
|
||||
*/
|
||||
private $mobilenumber = '';
|
||||
|
||||
/**
|
||||
* @var Collection
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity="Chill\PersonBundle\Entity\PersonPhone",
|
||||
* mappedBy="person",
|
||||
* cascade={"persist", "remove", "merge", "detach"},
|
||||
* orphanRemoval=true
|
||||
* )
|
||||
*/
|
||||
private $otherPhoneNumbers;
|
||||
|
||||
//TO-ADD caseOpeningDate
|
||||
//TO-ADD nativeLanguag
|
||||
|
||||
@@ -248,15 +260,14 @@ class Person implements HasCenterInterface
|
||||
* @ORM\OrderBy({"validFrom" = "DESC"})
|
||||
*/
|
||||
private $addresses;
|
||||
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
private $fullnameCanonical;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Person constructor.
|
||||
*
|
||||
@@ -268,6 +279,7 @@ class Person implements HasCenterInterface
|
||||
$this->spokenLanguages = new ArrayCollection();
|
||||
$this->addresses = new ArrayCollection();
|
||||
$this->altNames = new ArrayCollection();
|
||||
$this->otherPhoneNumbers = new ArrayCollection();
|
||||
|
||||
if ($opening === null) {
|
||||
$opening = new \DateTime();
|
||||
@@ -285,7 +297,7 @@ class Person implements HasCenterInterface
|
||||
$accompanyingPeriod->setPerson($this);
|
||||
$this->accompanyingPeriods->add($accompanyingPeriod);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriod $accompanyingPeriod
|
||||
*/
|
||||
@@ -476,7 +488,7 @@ class Person implements HasCenterInterface
|
||||
{
|
||||
return $this->lastName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
@@ -484,7 +496,7 @@ class Person implements HasCenterInterface
|
||||
{
|
||||
return $this->altNames;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Collection $altNames
|
||||
* @return $this
|
||||
@@ -492,10 +504,10 @@ class Person implements HasCenterInterface
|
||||
public function setAltNames(Collection $altNames)
|
||||
{
|
||||
$this->altNames = $altNames;
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param PersonAltName $altName
|
||||
* @return $this
|
||||
@@ -506,24 +518,24 @@ class Person implements HasCenterInterface
|
||||
$this->altNames->add($altName);
|
||||
$altName->setPerson($this);
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param PersonAltName $altName
|
||||
* @return $this
|
||||
*/
|
||||
public function removeAltName(PersonAltName $altName)
|
||||
public function removeAltName(PersonAltName $altName)
|
||||
{
|
||||
if ($this->altNames->contains($altName)) {
|
||||
$altName->setPerson(null);
|
||||
$this->altNames->removeElement($altName);
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set birthdate
|
||||
*
|
||||
@@ -760,7 +772,7 @@ class Person implements HasCenterInterface
|
||||
{
|
||||
return $this->nationality;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
@@ -863,7 +875,53 @@ class Person implements HasCenterInterface
|
||||
{
|
||||
return $this->mobilenumber;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getOtherPhoneNumbers(): Collection
|
||||
{
|
||||
return $this->otherPhoneNumbers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $otherPhoneNumbers
|
||||
* @return $this
|
||||
*/
|
||||
public function setOtherPhoneNumbers(Collection $otherPhoneNumbers)
|
||||
{
|
||||
$this->otherPhoneNumbers = $otherPhoneNumbers;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PersonPhone $otherPhoneNumber
|
||||
* @return $this
|
||||
*/
|
||||
public function addOtherPhoneNumber(PersonPhone $otherPhoneNumber)
|
||||
{
|
||||
if (false === $this->otherPhoneNumbers->contains($otherPhoneNumber)) {
|
||||
$otherPhoneNumber->setPerson($this);
|
||||
$this->otherPhoneNumbers->add($otherPhoneNumber);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PersonPhone $otherPhoneNumber
|
||||
* @return $this
|
||||
*/
|
||||
public function removeOtherPhoneNumber(PersonPhone $otherPhoneNumber)
|
||||
{
|
||||
if ($this->otherPhoneNumbers->contains($otherPhoneNumber)) {
|
||||
$this->otherPhoneNumbers->removeElement($otherPhoneNumber);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
@@ -894,7 +952,7 @@ class Person implements HasCenterInterface
|
||||
{
|
||||
return $this->spokenLanguages;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Address $address
|
||||
* @return $this
|
||||
@@ -905,7 +963,7 @@ class Person implements HasCenterInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Address $address
|
||||
*/
|
||||
@@ -924,7 +982,7 @@ class Person implements HasCenterInterface
|
||||
{
|
||||
return $this->addresses;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \DateTime|null $date
|
||||
* @return null
|
||||
|
Reference in New Issue
Block a user