Attendance: Fix entity

pull/3984/head
Julio 4 years ago
parent 5585160f76
commit 610be461a4
  1. 2
      public/main/course_progress/index.php
  2. 10
      public/main/inc/lib/thematic.lib.php

@ -1200,7 +1200,7 @@ switch ($action) {
$startDate = $values['start_date_by_attendance'];
}
$advanceId = isset($values['thematic_advance_id']) ? $values['thematic_advance_id'] : null;
$advanceId = $values['thematic_advance_id'] ?? null;
$advance = null;
if (!empty($advanceId)) {
$advance = Container::getThematicAdvanceRepository()->find($advanceId);

@ -544,7 +544,7 @@ class Thematic
*/
public function thematicAdvanceSave(
CThematic $thematic,
CAttendance $attendance,
CAttendance $attendance = null,
CThematicAdvance $advance = null,
$content,
$start_date,
@ -554,15 +554,17 @@ class Thematic
$duration = (int) $duration;
if (null === $advance) {
$advance = new CThematicAdvance();
$advance
$advance = (new CThematicAdvance())
->setContent($content)
->setThematic($thematic)
->setAttendance($attendance)
//->setAttendance($attendance)
->setStartDate(api_get_utc_datetime($start_date, true, true))
->setDuration($duration)
;
if ($attendance) {
$advance->setAttendance($attendance);
}
//$courseEntity = api_get_course_entity();
/*$advance
->setParent($courseEntity)

Loading…
Cancel
Save