Beispiel #1
0
func (a Album) FindAlbumPhotos(albumId int) []Photo {
	var album Album
	var photos []Photo

	conn := db.GetConnection()
	conn.Debug().First(&album, albumId)
	conn.Debug().Model(&album).Related(&photos)

	return photos
}
Beispiel #2
0
func (a Article) FindOne(id int) Article {
	article := Article{}
	conn := db.GetConnection()
	conn.Debug().First(&article, id)
	return article
}
Beispiel #3
0
func (a Album) FindOne(id int) Album {
	album := Album{}
	conn := db.GetConnection()
	conn.Debug().First(&album, id)
	return album
}
Beispiel #4
0
func (g Game) FindOne(id int) Game {
	game := Game{}
	conn := db.GetConnection()
	conn.Debug().First(&game, id)
	return game
}