// Code generated by go-swagger; DO NOT EDIT. package models // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" "github.com/go-openapi/swag" "github.com/go-xorm/xorm" ) // Teacher teacher // swagger:model Teacher type Teacher struct { // An unique string that is mostly the abbreviation of the teacher's name Identifier string `json:"identifier,omitempty" xorm:"pk"` // The family name of the teacher Name string `json:"name,omitempty"` } /* polymorph Teacher identifier false */ /* polymorph Teacher name false */ func getTeacherByIdentifier(engine *xorm.Engine, identifier string) (teacher *Teacher, err error) { teacher = new(Teacher) _, err = engine.ID(identifier).Get(teacher) return } // Validate validates this teacher func (m *Teacher) Validate(formats strfmt.Registry) error { var res []error if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } // MarshalBinary interface implementation func (m *Teacher) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } return swag.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Teacher) UnmarshalBinary(b []byte) error { var res Teacher if err := swag.ReadJSON(b, &res); err != nil { return err } *m = res return nil }