MCPcopy
hub / github.com/go-gorm/gorm / Append

Method Append

association.go:58–73  ·  view source on GitHub ↗
(values ...interface{})

Source from the content-addressed store, hash-verified

56}
57
58func (association *Association) Append(values ...interface{}) error {
59 values = expandValues(values)
60
61 if association.Error == nil {
62 switch association.Relationship.Type {
63 case schema.HasOne, schema.BelongsTo:
64 if len(values) > 0 {
65 association.Error = association.Replace(values...)
66 }
67 default:
68 association.saveAssociation( /*clear*/ false, values...)
69 }
70 }
71
72 return association.Error
73}
74
75func (association *Association) Replace(values ...interface{}) error {
76 values = expandValues(values)

Callers 15

ScanFunction · 0.80
DeleteMethod · 0.80
saveAssociationMethod · 0.80
SaveBeforeAssociationsFunction · 0.80
SaveAfterAssociationsFunction · 0.80
preloadEntryPointFunction · 0.80
preloadFunction · 0.80
TestBelongsToAssociationFunction · 0.80

Calls 3

ReplaceMethod · 0.95
saveAssociationMethod · 0.95
expandValuesFunction · 0.85