12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- package fetdata
- import (
- "golang-fave/engine/wrapper"
- "golang-fave/utils"
- )
- type BlogCategory struct {
- wrap *wrapper.Wrapper
- object *utils.MySql_blog_category
- depth int
- user *User
- }
- func (this *BlogCategory) load() *BlogCategory {
- return this
- }
- func (this *BlogCategory) Id() int {
- if this == nil {
- return 0
- }
- return this.object.A_id
- }
- func (this *BlogCategory) User() *User {
- if this == nil {
- return nil
- }
- if this.user != nil {
- return this.user
- }
- this.user = &User{wrap: this.wrap}
- this.user.loadById(this.object.A_user)
- return this.user
- }
- func (this *BlogCategory) Name() string {
- if this == nil {
- return ""
- }
- return this.object.A_name
- }
- func (this *BlogCategory) Alias() string {
- if this == nil {
- return ""
- }
- return this.object.A_alias
- }
- func (this *BlogCategory) Left() int {
- if this == nil {
- return 0
- }
- return this.object.A_lft
- }
- func (this *BlogCategory) Right() int {
- if this == nil {
- return 0
- }
- return this.object.A_rgt
- }
- func (this *BlogCategory) Permalink() string {
- if this == nil {
- return ""
- }
- return "/blog/category/" + this.object.A_alias + "/"
- }
- func (this *BlogCategory) Level() int {
- if this == nil {
- return 0
- }
- return this.depth
- }
|