Esempio n. 1
0
func (o *Object) ReadManyPage(page, pagesInPage uint64, filter *db.Filter) ([]interface{}, error) {
	if filter == nil {
		filter = &db.Filter{}
	}

	filter.Limit = pagesInPage
	filter.Offset = (page - 1) * pagesInPage

	return o.ReadMany(filter)
}
Esempio n. 2
0
func (s *Product) ReadManyByType(t ProductType, f *db.Filter) (res []*Product, e error) {
	if f == nil {
		f = &db.Filter{}
	}
	f.WhereEq = append(f.WhereEq, map[string]interface{}{"Type": t})

	return s.ReadMany(f)
}