mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Merge remote-tracking branch 'origin/master' into features/household-edit-members-forms-improve-household
This commit is contained in:
@@ -340,21 +340,6 @@ class Household
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function validate(ExecutionContextInterface $context, $payload)
|
||||
{
|
||||
$addresses = $this->getAddresses();
|
||||
$cond = True;
|
||||
for ($i=0; $i < count($addresses) - 1; $i++) {
|
||||
if ($addresses[$i]->getValidFrom() != $addresses[$i + 1]->getValidTo()) {
|
||||
$cond = False;
|
||||
$context->buildViolation('The address are not sequentials. The validFrom date of one address should be equal to the validTo date of the previous address.')
|
||||
->atPath('addresses')
|
||||
->addViolation();
|
||||
}
|
||||
}
|
||||
dump($cond);
|
||||
}
|
||||
|
||||
public function getCommentMembers(): CommentEmbeddable
|
||||
{
|
||||
return $this->commentMembers;
|
||||
@@ -391,4 +376,18 @@ class Household
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function validate(ExecutionContextInterface $context, $payload)
|
||||
{
|
||||
$addresses = $this->getAddresses();
|
||||
$cond = True;
|
||||
for ($i=0; $i < count($addresses) - 1; $i++) {
|
||||
if ($addresses[$i]->getValidFrom() != $addresses[$i + 1]->getValidTo()) {
|
||||
$cond = False;
|
||||
$context->buildViolation('The address are not sequentials. The validFrom date of one address should be equal to the validTo date of the previous address.')
|
||||
->atPath('addresses')
|
||||
->addViolation();
|
||||
}
|
||||
}
|
||||
dump($cond);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user