mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
normalization for docgen:read: add groups and so on (wip)
This commit is contained in:
@@ -59,7 +59,7 @@ class Household
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
* @Serializer\Groups({"read"})
|
||||
* @Serializer\Groups({"read", "docgen:read"})
|
||||
*/
|
||||
private ?int $id = null;
|
||||
|
||||
@@ -68,17 +68,19 @@ class Household
|
||||
* targetEntity=HouseholdMember::class,
|
||||
* mappedBy="household"
|
||||
* )
|
||||
* @Serializer\Groups({"read"})
|
||||
* @Serializer\Groups({"read", "docgen:read"})
|
||||
*/
|
||||
private Collection $members;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", name="waiting_for_birth", options={"default": false})
|
||||
* @Serializer\Groups({"docgen:read"})
|
||||
*/
|
||||
private bool $waitingForBirth = false;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="date_immutable", name="waiting_for_birth_date", nullable=true, options={"default": null})
|
||||
* @Serializer\Groups({"docgen:read"})
|
||||
*/
|
||||
private ?DateTimeImmutable $waitingForBirthDate = null;
|
||||
|
||||
@@ -134,7 +136,7 @@ class Household
|
||||
}
|
||||
|
||||
/**
|
||||
* @Serializer\Groups({ "read" })
|
||||
* @Serializer\Groups({"read", "docgen:read"})
|
||||
* @Serializer\SerializedName("current_address")
|
||||
*/
|
||||
public function getCurrentAddress(?DateTime $at = null): ?Address
|
||||
@@ -154,6 +156,11 @@ class Household
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateTimeImmutable|null $now
|
||||
* @return Collection
|
||||
* @Serializer\Groups({"docgen:read"})
|
||||
*/
|
||||
public function getCurrentMembers(?DateTimeImmutable $now = null): Collection
|
||||
{
|
||||
return $this->getMembers()->matching($this->buildCriteriaCurrentMembers($now));
|
||||
|
Reference in New Issue
Block a user