// GetDataForSchool returns the data associated with the User's enrollment in the given School.
GetDataForSchool returns the data associated with the User's enrollment in the given School.
// GetDataForSchool returns the data associated with the User ' s enrollment in the given School .
func GetDataForSchool(school *School, user *User) (map[string]interface{}, error) {
	schoolRow, err := DB.Query("SELECT data FROM schools WHERE schoolId = ? AND userId = ?", (*school).ID(), user.ID)
	if err != nil {
		return nil, err
	}
	defer schoolRow.Close()
	if !schoolRow.Next() {
		return nil, ErrNotFound
	}
	dataString := ""
	err = schoolRow.Scan(&dataString)
	if err != nil {
		return nil, err
	}
	data := map[string]interface{}{}
	err = json.Unmarshal([]byte(dataString), &data)
	if err != nil {
		return nil, err
	}
	return data, nil
}
func GetDataForSchool ( school * School , user * User ) ( map [ string ] interface { } , error ) { schoolRow , err := DB . Query ( " " , ( * school ) . ID ( ) , user . ID ) if err != nil { return nil , err } defer schoolRow . Close ( ) if ! schoolRow . Next ( ) { return nil , ErrNotFound } dataString := " " err = schoolRow . Scan ( & dataString ) if err != nil { return nil , err } data := map [ string ] interface { } { } err = json . Unmarshal ( [ ] byte ( dataString ) , & data ) if err != nil { return nil , err } return data , nil }
GetDataForSchool returns the data associated with the User's enrollment in the given School.
GetDataForSchool returns the data associated with the User ' s enrollment in the given School .