You are here

public function WebformGroupManager::getWebformSubmissionUserGroupRoles in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_group/src/WebformGroupManager.php \Drupal\webform_group\WebformGroupManager::getWebformSubmissionUserGroupRoles()

Get group roles for a webform submission and a specified user account.

Parameters

\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.

\Drupal\Core\Session\AccountInterface $account: A user account.

Return value

\Drupal\group\Entity\GroupContentInterface|bool The group role for the webform submission. FALSE if no group roles is found for the webform submission.

Overrides WebformGroupManagerInterface::getWebformSubmissionUserGroupRoles

File

modules/webform_group/src/WebformGroupManager.php, line 185

Class

WebformGroupManager
Webform group manager manager.

Namespace

Drupal\webform_group

Code

public function getWebformSubmissionUserGroupRoles(WebformSubmissionInterface $webform_submission, AccountInterface $account) {
  $group_content = $this
    ->getWebformSubmissionGroupContent($webform_submission);
  return $group_content ? $this
    ->getUserGroupRoles($group_content, $account) : [];
}