You are here

protected function LearningPathAchievementTrait::getCurrentActivityId in Opigno Learning path 3.x

Current Opigno Activity Id.

2 calls to LearningPathAchievementTrait::getCurrentActivityId()
OpignoCurrentCacheContext::getContext in src/Cache/Context/OpignoCurrentCacheContext.php
Returns the string representation of the cache context.
StepsBlock::processActivityList in src/Plugin/Block/StepsBlock.php
Converts a step array to a renderable array.

File

src/Traits/LearningPathAchievementTrait.php, line 103

Class

LearningPathAchievementTrait
LearningPathAchievementTrait trait.

Namespace

Drupal\opigno_learning_path\Traits

Code

protected function getCurrentActivityId() {
  if ($opigno_activity = $this
    ->routeMatch()
    ->getParameter('opigno_activity') ?? FALSE) {
    return $opigno_activity
      ->id();
  }
}