mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Historique ménage pour une personne
This commit is contained in:
@@ -1209,14 +1209,44 @@ class Person implements HasCenterInterface
|
||||
return $this->householdParticipations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get participation where the person does share the household.
|
||||
*
|
||||
* Order by startDate, desc
|
||||
*/
|
||||
public function getHouseholdParticipationsShareHousehold(): Collection
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$expr = Criteria::expr();
|
||||
|
||||
$criteria->where(
|
||||
$expr->eq('shareHousehold', true)
|
||||
);
|
||||
$criteria
|
||||
->where(
|
||||
$expr->eq('shareHousehold', true)
|
||||
)
|
||||
->orderBy(['startDate' => Criteria::DESC])
|
||||
;
|
||||
|
||||
return $this->getHouseholdParticipations()
|
||||
->matching($criteria)
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get participation where the person does not share the household.
|
||||
*
|
||||
* Order by startDate, desc
|
||||
*/
|
||||
public function getHouseholdParticipationsNotShareHousehold(): Collection
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$expr = Criteria::expr();
|
||||
|
||||
$criteria
|
||||
->where(
|
||||
$expr->eq('shareHousehold', false)
|
||||
)
|
||||
->orderBy(['startDate' => Criteria::DESC])
|
||||
;
|
||||
|
||||
return $this->getHouseholdParticipations()
|
||||
->matching($criteria)
|
||||
|
Reference in New Issue
Block a user