You are here

public function ILT::setTrainingId 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::setTrainingId()

Sets the ID of the related training.

Parameters

int|null $id: The ID of the related training.

Return value

$this

Overrides ILTInterface::setTrainingId

File

src/Entity/ILT.php, line 180

Class

ILT
Defines the ILT entity.

Namespace

Drupal\opigno_ilt\Entity

Code

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