MCPcopy
hub / github.com/pocketbase/pocketbase / getCollectionByModelOrIdentifier

Function getCollectionByModelOrIdentifier

core/record_query.go:195–206  ·  view source on GitHub ↗
(app App, collectionModelOrIdentifier any)

Source from the content-addressed store, hash-verified

193}
194
195func getCollectionByModelOrIdentifier(app App, collectionModelOrIdentifier any) (*Collection, error) {
196 switch c := collectionModelOrIdentifier.(type) {
197 case *Collection:
198 return c, nil
199 case Collection:
200 return &c, nil
201 case string:
202 return app.FindCachedCollectionByNameOrId(c)
203 default:
204 return nil, errors.New("unknown collection identifier - must be collection model, id or name")
205 }
206}
207
208// -------------------------------------------------------------------
209

Callers 9

expandRecordsMethod · 0.85
RecordQueryMethod · 0.85
FindRecordByIdMethod · 0.85
FindRecordsByIdsMethod · 0.85
FindFirstRecordByDataMethod · 0.85
FindRecordsByFilterMethod · 0.85
FindAuthRecordByEmailMethod · 0.85
loadCollectionMethod · 0.85
FindRecordByViewFileMethod · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…