(app App, collectionModelOrIdentifier any)
| 193 | } |
| 194 | |
| 195 | func 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 |
no test coverage detected
searching dependent graphs…