diff --git a/erm/templates/contentful_vo_lib.gotmpl b/erm/templates/contentful_vo_lib.gotmpl index e8bab64..8c5f118 100644 --- a/erm/templates/contentful_vo_lib.gotmpl +++ b/erm/templates/contentful_vo_lib.gotmpl @@ -425,6 +425,16 @@ func (cc *ContentfulClient) GetContentTypeOfID(ctx context.Context, id string) ( return vo.Sys.ContentType.Sys.ID, nil } +func (vo *GenericEntry) GetParents(ctx context.Context, contentType ...string) (parents []EntryReference, err error) { + if vo == nil { + return nil, errors.New("GetParents: Value Object is nil") + } + if vo.CC == nil { + return nil, errors.New("GetParents: Value Object has no Contentful Client set") + } + return commonGetParents(ctx, vo.CC, vo.Sys.ID, contentType) +} + func (ref EntryReference) GetParents(ctx context.Context, contentType ...string) (parents []EntryReference, err error) { if ref.ID == "" { return nil, errors.New("GetParents: reference is nil")