// SetRelationModels implements mapping.MultiRelationer interface.
SetRelationModels implements mapping.MultiRelationer interface.
// SetRelationModels implements mapping . MultiRelationer interface .
func (p *Post) SetRelationModels(relation *mapping.StructField, models ...mapping.Model) error {
	switch relation.Index[0] {
	case 6: 
		temp := make([]*Comment, len(models))
		for i, model := range models {
			comment, ok := model.(*Comment)
			if !ok {
				return errors.Wrapf(mapping.ErrInvalidRelationValue, "provided invalid value type: '%T'  for the field: 'Comments'", model)
			}
			temp[i] = comment
		}
		p.Comments = temp
	default:
		return errors.Wrapf(mapping.ErrInvalidRelationField, "provided invalid relation: '%s' for the model 'Post'", relation.String())
	}
	return nil
}
func ( p * Post ) SetRelationModels ( relation * mapping . StructField , models ... mapping . Model ) error { switch relation . Index [ 0 ] { case 6 : temp := make ( [ ] * Comment , len ( models ) ) for i , model := range models { comment , ok := model . ( * Comment ) if ! ok { return errors . Wrapf ( mapping . ErrInvalidRelationValue , " " , model ) } temp [ i ] = comment } p . Comments = temp default : return errors . Wrapf ( mapping . ErrInvalidRelationField , " " , relation . String ( ) ) } return nil }
SetRelationModels implements mapping.MultiRelationer interface.
SetRelationModels implements mapping . MultiRelationer interface .
// Comments