|
|
@ -78,12 +78,25 @@ func (d *Database) LoadArray(target interface{}, filters ...interface{}) (err er |
|
|
|
value := reflect.New(targetSliceElemT.Elem()) |
|
|
|
value := reflect.New(targetSliceElemT.Elem()) |
|
|
|
err = result.Decode(value.Interface()) |
|
|
|
err = result.Decode(value.Interface()) |
|
|
|
elem = value.Interface() |
|
|
|
elem = value.Interface() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
err = composed.OnCreate().Invoke(ctx, elem) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if err == nil { |
|
|
|
if err == nil { |
|
|
|
targetSliceV = reflect.Append(targetSliceV, value) |
|
|
|
targetSliceV = reflect.Append(targetSliceV, value) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
elem = targetSliceV.Index(i).Interface() |
|
|
|
elem = targetSliceV.Index(i).Interface() |
|
|
|
base.Reset(elem) |
|
|
|
|
|
|
|
|
|
|
|
if created := base.Reset(elem); created { |
|
|
|
|
|
|
|
err = composed.OnCreate().Invoke(ctx, elem) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
err = result.Decode(elem) |
|
|
|
err = result.Decode(elem) |
|
|
|
} |
|
|
|
} |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|