mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
person: create a person with address (and household without position (remove required position for household member)
This commit is contained in:
@@ -82,14 +82,13 @@ class HouseholdMember
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Position::class)
|
||||
* @Serializer\Groups({"read", "docgen:read"})
|
||||
* @Assert\NotNull(groups={"household_memberships_created"})
|
||||
*/
|
||||
private ?Position $position = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", name="sharedhousehold")
|
||||
*/
|
||||
private bool $shareHousehold = false;
|
||||
private bool $shareHousehold = true;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
||||
@@ -201,7 +200,7 @@ class HouseholdMember
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPosition(Position $position): self
|
||||
public function setPosition(?Position $position): self
|
||||
{
|
||||
if ($this->position instanceof Position) {
|
||||
throw new LogicException('The position is already set. You cannot change ' .
|
||||
@@ -209,7 +208,9 @@ class HouseholdMember
|
||||
}
|
||||
|
||||
$this->position = $position;
|
||||
$this->shareHousehold = $position->getShareHousehold();
|
||||
if (null !== $position){
|
||||
$this->shareHousehold = $position->getShareHousehold();
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user