MCPcopy
hub / github.com/pocketbase/pocketbase / GetByName

Method GetByName

core/fields_list.go:74–81  ·  view source on GitHub ↗

GetByName returns a single field by its name.

(fieldName string)

Source from the content-addressed store, hash-verified

72
73// GetByName returns a single field by its name.
74func (l FieldsList) GetByName(fieldName string) Field {
75 for _, field := range l {
76 if field.GetName() == fieldName {
77 return field
78 }
79 }
80 return nil
81}
82
83// RemoveById removes a single field by its id.
84//

Callers 15

TestFieldsListGetByNameFunction · 0.95
TestFieldsListRemoveFunction · 0.95
TestFieldsListAddFunction · 0.95
expandRecordsMethod · 0.80
TestFileFieldFindGetterFunction · 0.80
TestFileFieldInterceptFunction · 0.80
TestFileFieldInterceptTxFunction · 0.80
FindFirstRecordByDataMethod · 0.80
TestCollectionValidateFunction · 0.80

Calls 1

GetNameMethod · 0.65

Tested by 15

TestFieldsListGetByNameFunction · 0.76
TestFieldsListRemoveFunction · 0.76
TestFieldsListAddFunction · 0.76
TestFileFieldFindGetterFunction · 0.64
TestFileFieldInterceptFunction · 0.64
TestFileFieldInterceptTxFunction · 0.64
TestCollectionValidateFunction · 0.64
TestCollectionSaveModelFunction · 0.64