public function hasGroupId(int $id) : bool
    {
        $usergroups = $this->usergroups;

        foreach ($usergroups as $index => $usergroup) {
            if ($usergroup->group_id === $id) {
                return true;
            }
        }

        return false;
    }
public function hasGroupId(int $id) : bool
    {
        $usergroups = $this->usergroups;

        foreach ($usergroups as $index => $usergroup) {
            if ($usergroup->group_id === $id) {
                return true;
            }
        }

        return false;
    }
public function hasGroupId ( int $ id ) : bool { $ usergroups = $ this -> usergroups ; foreach ( $ usergroups as $ index => $ usergroup ) { if ( $ usergroup -> group_id === $ id ) { return true ; } } return false ; }
Check if user has group.

@param int $id
@return bool
Check if user has group .