MCPcopy Create free account
hub / github.com/pydio/cells / Serialize

Method Serialize

common/forms/forms.go:124–142  ·  view source on GitHub ↗

Serialize returns a list of serializable fields

(languages ...string)

Source from the content-addressed store, hash-verified

122
123// Serialize returns a list of serializable fields
124func (f *Form) Serialize(languages ...string) interface{} {
125 sForm := &SerialForm{}
126 var T i18n.TranslateFunc
127 if f.I18NBundle != nil {
128 T = f.I18NBundle.T(languages...)
129 } else {
130 T = i18n.IdentityFunc
131 }
132 for _, group := range f.Groups {
133 for _, field := range group.Fields {
134 serials := field.Serialize(T)
135 for _, serial := range serials {
136 serial.Group = T(group.Label)
137 sForm.Params = append(sForm.Params, serial)
138 }
139 }
140 }
141 return sForm
142}

Calls 3

TMethod · 0.80
SerializeMethod · 0.65
TFunction · 0.50

Tested by 3

TestFormField_SerializeFunction · 0.76