You are here

public function ILT::setCalendarEvent in Opigno Instructor-led Trainings 8

Same name and namespace in other branches
  1. 3.x src/Entity/ILT.php \Drupal\opigno_ilt\Entity\ILT::setCalendarEvent()

Sets the entity of the related calendar event.

Parameters

\Drupal\opigno_calendar_event\Entity\CalendarEvent $event: The entity of the related calendar event.

Return value

$this

Overrides ILTInterface::setCalendarEvent

File

src/Entity/ILT.php, line 240

Class

ILT
Defines the ILT entity.

Namespace

Drupal\opigno_ilt\Entity

Code

public function setCalendarEvent(CalendarEvent $event) {
  $this
    ->set('calendar_event', [
    'target_id' => $event
      ->id(),
  ]);
  return $this;
}