diff options
Diffstat (limited to 'models/repo_unit.go')
-rw-r--r-- | models/repo_unit.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/models/repo_unit.go b/models/repo_unit.go index ee61ef4c9d..f8f01c4398 100644 --- a/models/repo_unit.go +++ b/models/repo_unit.go @@ -135,3 +135,11 @@ func (r *RepoUnit) ExternalWikiConfig() *ExternalWikiConfig { func (r *RepoUnit) ExternalTrackerConfig() *ExternalTrackerConfig { return r.Config.(*ExternalTrackerConfig) } + +func getUnitsByRepoID(e Engine, repoID int64) (units []*RepoUnit, err error) { + return units, e.Where("repo_id = ?", repoID).Find(&units) +} + +func getUnitsByRepoIDAndIDs(e Engine, repoID int64, types []UnitType) (units []*RepoUnit, err error) { + return units, e.Where("repo_id = ?", repoID).In("`type`", types).Find(&units) +} |