mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
Adapt entity AccompanyingPeriodParticipation attributes and methods (dont break UI)
This commit is contained in:
@@ -88,12 +88,12 @@ class AccompanyingPeriodController extends AbstractController
|
||||
$this->denyAccessUnlessGranted(PersonVoter::UPDATE, $person,
|
||||
'You are not allowed to update this person');
|
||||
|
||||
$accompanyingPeriod = new AccompanyingPeriod(new \DateTime());
|
||||
$accompanyingPeriod->setClosingDate(new \DateTime());
|
||||
|
||||
$person->addAccompanyingPeriod(
|
||||
$accompanyingPeriod);
|
||||
|
||||
$accompanyingPeriod = new AccompanyingPeriod(new \DateTimeImmutable('now'));
|
||||
$accompanyingPeriod->setClosingDate(new \DateTimeImmutable('now'));
|
||||
|
||||
$accompanyingPeriod->addPerson($person);
|
||||
//or $person->addAccompanyingPeriod($accompanyingPeriod);
|
||||
|
||||
$form = $this->createForm(
|
||||
AccompanyingPeriodType::class,
|
||||
$accompanyingPeriod, [
|
||||
@@ -153,8 +153,9 @@ class AccompanyingPeriodController extends AbstractController
|
||||
}
|
||||
|
||||
/** @var Person $person */
|
||||
$person = $em->getRepository(Person::class)->find($person_id);
|
||||
$person = $this->_getPerson($person_id);
|
||||
|
||||
// CHECK
|
||||
if (! $accompanyingPeriod->containsPerson($person)) {
|
||||
throw new Exception("Accompanying period " . $period_id . " does not contain person " . $person_id);
|
||||
}
|
||||
|
Reference in New Issue
Block a user