Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for call_method (0.19 sec)

  1. callbacks/delete.go

    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils"
    )
    
    func BeforeDelete(db *gorm.DB) {
    	if db.Error == nil && db.Statement.Schema != nil && !db.Statement.SkipHooks && db.Statement.Schema.BeforeDelete {
    		callMethod(db, func(value interface{}, tx *gorm.DB) bool {
    			if i, ok := value.(BeforeDeleteInterface); ok {
    				db.AddError(i.BeforeDelete(tx))
    				return true
    			}
    
    			return false
    		})
    	}
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Feb 25 02:48:23 GMT 2022
    - 5.6K bytes
    - Viewed (0)
Back to top