gorm/callbacks/create.go

22 lines
621 B
Go
Raw Normal View History

2014-01-26 08:41:37 +04:00
package callbacks
2014-01-24 17:52:26 +04:00
2014-01-26 08:41:37 +04:00
import "github.com/jinzhu/gorm"
2014-01-24 17:52:26 +04:00
func Create(scope *gorm.Scope) {
}
func init() {
gorm.DefaultCallback.Create().Before().Register(Create)
}
func init() {
DefaultCallback.Create().Before("Delete").After("Lalala").Register("delete", Delete)
DefaultCallback.Update().Before("Delete").After("Lalala").Remove("replace", Delete)
DefaultCallback.Delete().Before("Delete").After("Lalala").Replace("replace", Delete)
DefaultCallback.Query().Before("Delete").After("Lalala").Replace("replace", Delete)
}
// Scope
// HasError(), HasColumn(), CallMethod(), Raw(), Exec()
// TableName(), CombinedQuerySQL()