MCPcopy Create free account
hub / github.com/gogs/gogs / CountByUser

Method CountByUser

internal/database/organizations.go:66–69  ·  view source on GitHub ↗

CountByUser returns the number of organizations the user is a member of.

(ctx context.Context, userID int64)

Source from the content-addressed store, hash-verified

64
65// CountByUser returns the number of organizations the user is a member of.
66func (s *OrganizationsStore) CountByUser(ctx context.Context, userID int64) (int64, error) {
67 var count int64
68 return count, s.db.WithContext(ctx).Model(&OrgUser{}).Where("uid = ?", userID).Count(&count).Error
69}
70
71type Organization = User
72

Callers 2

GetOrganizationCountMethod · 0.80
organizationsCountByUserFunction · 0.80

Calls 2

WhereMethod · 0.80
CountMethod · 0.45

Tested by 1

organizationsCountByUserFunction · 0.64