Exemplo n.º 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
}
Exemplo n.º 2
0
func (a Article) FindOne(id int) Article {
	article := Article{}
	conn := db.GetConnection()
	conn.Debug().First(&article, id)
	return article
}
Exemplo n.º 3
0
func (a Album) FindOne(id int) Album {
	album := Album{}
	conn := db.GetConnection()
	conn.Debug().First(&album, id)
	return album
}
Exemplo n.º 4
0
func (g Game) FindOne(id int) Game {
	game := Game{}
	conn := db.GetConnection()
	conn.Debug().First(&game, id)
	return game
}