first impl of person Mover + add fixtures

This commit is contained in:
2021-05-28 16:41:37 +02:00
parent 94bcbac06a
commit 87ba68971c
13 changed files with 384 additions and 21 deletions

View File

@@ -26,6 +26,7 @@ use ArrayIterator;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\Country;
use Chill\PersonBundle\Entity\MaritalStatus;
use Chill\PersonBundle\Entity\Household\HouseholdMember;
use Chill\MainBundle\Entity\HasCenterInterface;
use Chill\MainBundle\Entity\Address;
use DateTime;
@@ -272,6 +273,14 @@ class Person implements HasCenterInterface
*/
private $fullnameCanonical;
/**
* @ORM\OneToMany(
* targetEntity=HouseholdMember::class,
* mappedBy="person"
* )
*/
private Collection $householdParticipations;
/**
* Person constructor.
*
@@ -284,6 +293,7 @@ class Person implements HasCenterInterface
$this->addresses = new ArrayCollection();
$this->altNames = new ArrayCollection();
$this->otherPhoneNumbers = new ArrayCollection();
$this->householdParticipations = new ArrayCollection();
if ($opening === null) {
$opening = new \DateTime();
@@ -1180,4 +1190,16 @@ class Person implements HasCenterInterface
$this->fullnameCanonical = $fullnameCanonical;
return $this;
}
public function addHouseholdParticipation(HouseholdMember $member): self
{
$this->householdParticipations[] = $member;
return $this;
}
public function getHouseholdParticipations(): Collection
{
return $this->householdParticipations;
}
}