You are here

public static function LPResult::createWithValues in Opigno Learning path 8

Same name and namespace in other branches
  1. 3.x src/Entity/LPResult.php \Drupal\opigno_learning_path\Entity\LPResult::createWithValues()

Creates LPResult object.

2 calls to LPResult::createWithValues()
LearningPathStepsController::finish in src/Controller/LearningPathStepsController.php
Show the finish page and save the score.
LearningPathStepsController::start in src/Controller/LearningPathStepsController.php
Start the learning path.

File

src/Entity/LPResult.php, line 37

Class

LPResult
Defines the Learning Path Content entity.

Namespace

Drupal\opigno_learning_path\Entity

Code

public static function createWithValues($learning_path_id, $user_id, $has_passed, $finished) {
  $values = [
    'learning_path_id' => $learning_path_id,
    'user_id' => $user_id,
    'has_passed' => $has_passed,
    'finished' => $finished,
  ];
  return parent::create($values);
}