// IncludePosts includes given 'relation' in the _Blogs query.
// An optional 'relationFieldset' defines the fields to return in the included relation.
IncludePosts includes given 'relation' in the _Blogs query.
An optional 'relationFieldset' defines the fields to return in the included relation.
// IncludePosts includes given ' relation ' in the _Blogs query . // An optional ' relationFieldset ' defines the fields to return in the included relation .
func (b *blogsQueryBuilder) IncludePosts(postsFieldset ...string) *blogsQueryBuilder {
	if b.err != nil {
		return b
	}
	relation, err := NRN_Blogs.Model.RelationByIndex(3)
	if err != nil {
		b.err = errors.Wrapf(mapping.ErrInternal, "Getting 'Posts' by index for model 'Blog' failed: %v", err)
		return b
	}
	var relationFields []*mapping.StructField
	for _, field := range postsFieldset {
		structField, ok := relation.ModelStruct().FieldByName(field)
		if !ok {
			b.err = errors.Wrapf(mapping.ErrInvalidModelField, "field: '%s' is not found for the 'Post' model", field)
			return b
		}
		relationFields = append(relationFields, structField)
	}
	b.builder.Include(relation, relationFields...)
	return b
}
func ( b * blogsQueryBuilder ) IncludePosts ( postsFieldset ... string ) * blogsQueryBuilder { if b . err != nil { return b } relation , err := NRN_Blogs . Model . RelationByIndex ( 3 ) if err != nil { b . err = errors . Wrapf ( mapping . ErrInternal , " " , err ) return b } var relationFields [ ] * mapping . StructField for _ , field := range postsFieldset { structField , ok := relation . ModelStruct ( ) . FieldByName ( field ) if ! ok { b . err = errors . Wrapf ( mapping . ErrInvalidModelField , " " , field ) return b } relationFields = append ( relationFields , structField ) } b . builder . Include ( relation , relationFields ... ) return b }
IncludePosts includes given 'relation' in the _Blogs query.
IncludePosts includes given ' relation ' in the _Blogs query .
// check the fieldset for the relation.