You are here

public function LPManagedContent::setLearningPath in Opigno Learning path 3.x

Same name and namespace in other branches
  1. 8 src/Entity/LPManagedContent.php \Drupal\opigno_learning_path\Entity\LPManagedContent::setLearningPath()

Sets learning path entity.

File

src/Entity/LPManagedContent.php, line 109

Class

LPManagedContent
Defines the Learning Path Content entity.

Namespace

Drupal\opigno_learning_path\Entity

Code

public function setLearningPath(Group $learning_path) {
  if ($learning_path
    ->getGroupType()
    ->id() != 'learning_path') {
    return FALSE;
  }
  $this
    ->setLearningPathId($learning_path
    ->id());
  return $this;
}