mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
Merge remote-tracking branch 'origin/master' into features/household-edit-members-forms-improve-household
This commit is contained in:
commit
e1f01a47f8
@ -177,4 +177,5 @@ class HouseholdController extends AbstractController
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -553,11 +553,24 @@ class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
$center = $em->getRepository(Center::class)
|
||||
->findOneBy(array('name' => 'Center A'));
|
||||
|
||||
$personIds = $em->createQuery("SELECT p.id FROM ".
|
||||
Person::class." p ".
|
||||
" WHERE p.center = :center")
|
||||
$qb = $em->createQueryBuilder();
|
||||
$personIds = $qb
|
||||
->select('p.id')
|
||||
->from(Person::class, 'p')
|
||||
->where(
|
||||
$qb->expr()->eq(
|
||||
'p.center',
|
||||
':center'
|
||||
)
|
||||
)
|
||||
->andWhere(
|
||||
$qb->expr()->gt(
|
||||
'SIZE(p.accompanyingPeriodParticipations)',
|
||||
0)
|
||||
)
|
||||
->setParameter('center', $center)
|
||||
->setMaxResults($maxResults)
|
||||
->getQuery()
|
||||
->getScalarResult();
|
||||
|
||||
// create a random order
|
||||
|
Loading…
x
Reference in New Issue
Block a user