Returns the current user's group.

@return \Ekyna\Bundle\UserBundle\Model\GroupInterface|null
492096
private function getUserGroup()
    {
        if (null !== $token = $this->tokenStorage->getToken()) {
            /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */
            if (null !== $user = $token->getUser()) {
                return $user->getGroup();
            }
        }
        return null;
    }
643267
public function getAuthorisedGroups()
	{
		if (is_null($this->authGroups))
		{
			$this->authGroups = array();
		}

		if (empty($this->authGroups))
		{
			$this->authGroups = Access::getGroupsByUser($this->get('id'));
		}

		return $this->authGroups;
	}
335866
public function groups()
    {
        $return = ['everyone'];

        $groups = GroupMember::where('user_id', $this->id())
            ->sort('`group` ASC')
            ->all();

        foreach ($groups as $group) {
            $return[] = $group->group;
        }

        return $return;
    }
556562
public function getUserAgent()
    {
        if ($this->USER_AGENT) {
            return $this->USER_AGENT;
        }

        if ($this->HTTP_USER_AGENT) {
            return $this->HTTP_USER_AGENT;
        }

        return null;
    }
721274
public function getResourceGroupsUrl() {
        return Http\ResourceGroupsUrl::factory(
            $this->getBaseUrl() . '/groups.json',
            $this->getConfig('privateKey'),
            $this->getPublicKey()
        );
    }
1311288
public function getGroup(): string
    {
        if ($this->caching == false) {
            $groupId = $this->getGroupId();

            if ($groupId == -2) {
                return "";
            }

            $group = posix_getgrgid($groupId);

            return $group["name"];
        }

        if ($this->group == null) {
            $groupId = $this->getOwnerId();

            if ($groupId == -2) {
                $this->group = "";
            }

            $group = posix_getpwuid($groupId);

            $this->group = $group["name"];
        }

        return $this->group;
    }
90265
public function getuser(){
		if(empty($this->user)){
			return NULL;
			}
		bimport('users.general');
		$bu=BUsers::getInstance();
		$user=$bu->itemGet($this->user);
		return $user;
		}
897792
public function getGroup() {

		if(false !== $this -> file -> getExists()) {

			$this -> refresh();
			
			return $this -> file -> getGroup();
		}
	}
472032
public function getGroup() {

		$groupTable = CmnTables::getTableName( CmnTables::TABLE_GROUP );

		return $this->hasOne( Group::class, [ 'id' => 'groupId' ] )->from( "$groupTable group" );
	}
1150619
protected function getGroups() {
    $types = [];
    /** @var \Drupal\group\Entity\GroupType $group_type */
    foreach (GroupType::loadMultiple() as $group_type) {
      // We can only select group types that have the 'join group'
      // permission enabled.
      if (in_array('join group', $group_type->getOutsiderRole()->getPermissions())) {
        $types[] = $group_type;
      }
    }
    return $types;
  }
1088463
private function get_groups_all() {
        if (is_null($this->groups)) {
            // NOTE: Performance could be improved here. The system caches user groups
            // in $USER->groupmember[$courseid] => array of groupid=>groupid. Unfortunately this
            // structure does not include grouping information. It probably could be changed to
            // do so, without a significant performance hit on login, thus saving this one query
            // each request.
            $this->groups = groups_get_user_groups($this->course->id, $this->userid);
        }
        return $this->groups;
    }
693609
private function findMostRelevantGroupId()
    {
        if ($this->siteManager->hasDependentContext('group')) {

            /** @var \MakinaCorpus\Ucms\Site\Group $group */
            $group = $this->siteManager->getDependentContext('group');

            if ($group) {
                return (int)$group->getId();
            }
        }

        // There is no context, this means we need to check with user current
        // groups instead; and set the first one we find onto the node
        $accessList = $this->groupManager->getUserGroups($this->currentUser);
        if ($accessList) {
            return (int)reset($accessList)->getGroupId();
        }
    }
447063
public function getInfo()
    {
        $request = new GetGroupInfoRequest([$this->groupId]);
        $response = new GetGroupInfoResponse();
        return $this->client->sendRequest($request, $response);
    }
1185504
protected function getCurrentUser()
    {
        /** @var \RcmUser\Service\RcmUserService $rcmUserService */
        $rcmUserService = $this->serviceLocator->get(
            \RcmUser\Service\RcmUserService::class
        );

        return $rcmUserService->getCurrentUser();
    }
1122878
public function get_value() {
		if ( $this->group && null === $this->value ) {
			return $this->value = $this->get_value_in_group();
		}

		return $this->value;
	}
215243
public function getAuthUserGroup()
    {
        $user_groups = Auth::user()->find(Auth::user()->id)->group;

        // create an array
        $usergroupArray = [];
        foreach ($user_groups as $user_group) {
            $usergroupArray[] = $user_group->title;
        }

        return $usergroupArray;
    }
173422
public function get()
    {
        if ($this->adminUser instanceof AdminUserInterface) {
            return $this->adminUser;
        }

        $token = $this->tokenStorage instanceof TokenStorageInterface
            ? $this->tokenStorage->getToken()
            : null;

        $this->adminUser = ($token instanceof UsernamePasswordToken)
            ? $token->getUser()
            : $this
                ->adminUserFactory
                ->create();

        return $this->adminUser;
    }