You are here

public function OpignoLearningPathProgress::render in Opigno Learning path 3.x

Same name and namespace in other branches
  1. 8 src/Plugin/views/field/OpignoLearningPathProgress.php \Drupal\opigno_learning_path\Plugin\views\field\OpignoLearningPathProgress::render()

Throws

\Exception

Overrides FieldPluginBase::render

File

src/Plugin/views/field/OpignoLearningPathProgress.php, line 69

Class

OpignoLearningPathProgress
Field handler to output user progress for current LP.

Namespace

Drupal\opigno_learning_path\Plugin\views\field

Code

public function render(ResultRow $values) {

  // Get an entity object.
  $entity = $values->_entity;
  $group = $entity instanceof LatestActivity ? $entity
    ->getTraining() : $entity;
  return !is_null($group) ? $this->progress
    ->getProgressBuild($group
    ->id(), $this->uid, '', 'full') : '';
}