فهرست منبع

Add CompleteName helper

Andrea Fazzi 6 سال پیش
والد
کامیت
25ed2837f5
1فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 5 0
      orm/teacher.go

+ 5 - 0
orm/teacher.go

@@ -1,6 +1,7 @@
 package orm
 
 import (
+	"fmt"
 	"net/http"
 
 	"github.com/jinzhu/gorm"
@@ -242,3 +243,7 @@ func (t Teacher) IsCoordinatorInClass(className string) bool {
 	return false
 
 }
+
+func (t *Teacher) CompleteName() string {
+	return fmt.Sprintf("%s %s", t.Name, t.Surname)
+}