You are here

public static function LearningPathController::loadGroupByForum in Opigno Learning path 3.x

Loads a group by LP forum term.

1 call to LearningPathController::loadGroupByForum()
opigno_learning_path_system_breadcrumb_alter in ./opigno_learning_path.module
Implements hook_system_breadcrumb_alter().

File

src/Controller/LearningPathController.php, line 596

Class

LearningPathController
Class LearningPathController.

Namespace

Drupal\opigno_learning_path\Controller

Code

public static function loadGroupByForum(Term $term) {
  $query = \Drupal::entityQuery('group')
    ->condition('field_learning_path_forum.target_id', $term
    ->id());
  $nids = $query
    ->execute();
  return $nids ? Group::load(reset($nids)) : FALSE;
}