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