function opigno_ilt_opigno_ilt_update in Opigno Instructor-led Trainings 3.x
Same name and namespace in other branches
- 8 opigno_ilt.module \opigno_ilt_opigno_ilt_update()
Implements hook_ENTITY_TYPE_update().
Updates a calendar event related to a instructor-led training.
File
- ./
opigno_ilt.module, line 309 - Contains opigno_ilt.module.
Code
function opigno_ilt_opigno_ilt_update(EntityInterface $entity) {
// Set instructor-led training reference on a related calendar event.
/** @var \Drupal\opigno_ilt\ILTInterface $entity */
$calendar_event = $entity
->getCalendarEvent();
if (isset($calendar_event)) {
$calendar_event
->set('field_ilt', $entity);
$calendar_event
->save();
}
}