Пример #1
0
// Exists checks if a Customer instance already exists in database.
// FIXME: Use external db connector.
func (c *Customer) Exists() bool {
	exists, err := utils.SimpleExists("customers", c.ID)
	utils.PanicOnError(err)
	return exists
}
Пример #2
0
// Exists checks if an Order instance already exists in database.
// FIXME: Use external db connector.
func (o *Order) Exists() bool {
	exists, err := utils.SimpleExists("orders", o.ID)
	utils.PanicOnError(err)
	return exists
}
Пример #3
0
// Exists checks if a Product instance is already in database.
// FIXME: Use external db connector.
func (p *Product) Exists() bool {
	exists, err := utils.SimpleExists("products", p.ID)
	utils.PanicOnError(err)
	return exists
}