create max holder validator

This commit is contained in:
2021-06-11 17:03:48 +02:00
parent 4fd6d38187
commit ecc8b929ca
4 changed files with 142 additions and 2 deletions

View File

@@ -98,6 +98,18 @@ class Household
return $this->members;
}
public function getMembersHolder(): Collection
{
$criteria = new Criteria();
$expr = Criteria::expr();
$criteria->where(
$expr->eq('holder', true)
);
return $this->getMembers()->matching($criteria);
}
public function getCurrentMembers(?\DateTimeImmutable $now = null): Collection
{
$criteria = new Criteria();