public static function OpignoGroupContext::setGroupId in Opigno group manager 8
Same name and namespace in other branches
- 3.x 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_managerCode
public static function setGroupId($group_id) {
static::ensureSession();
/** @var \Drupal\Core\TempStore\PrivateTempStore $store */
$store = \Drupal::service('user.private_tempstore')
->get('opigno_group_manager');
$store
->set(self::GROUP_ID, $group_id);
}