You are here

public static function OpignoGroupContext::setGroupId in Opigno group manager 3.x

Same name and namespace in other branches
  1. 8 src/OpignoGroupContext.php \Drupal\opigno_group_manager\OpignoGroupContext::setGroupId()

Set the context Group ID.

Parameters

int $group_id: Group ID.

Throws

\Drupal\Core\TempStore\TempStoreException

File

src/OpignoGroupContext.php, line 92

Class

OpignoGroupContext
This class manage the context when a user enters or exits a Learning Path.

Namespace

Drupal\opigno_group_manager

Code

public static function setGroupId($group_id) {
  static::ensureSession();

  /** @var \Drupal\Core\TempStore\PrivateTempStore $store */
  $store = \Drupal::service('tempstore.private')
    ->get('opigno_group_manager');
  $store
    ->set(self::GROUP_ID, $group_id);
}