You are here

public function ILT::setTraining in Opigno Instructor-led Trainings 3.x

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

Sets the related training.

Parameters

\Drupal\group\Entity\GroupInterface|null $training: The related training entity.

Return value

$this

Overrides ILTInterface::setTraining

File

src/Entity/ILT.php, line 210

Class

ILT
Defines the ILT entity.

Namespace

Drupal\opigno_ilt\Entity

Code

public function setTraining($training) {
  $this
    ->set('training', [
    'target_id' => $training
      ->id(),
  ]);
  return $this;
}