+general tables

This commit is contained in:
Simon Martens
2026-01-12 15:16:11 +01:00
parent 925f22607b
commit 696f7fe087
9 changed files with 486 additions and 0 deletions

59
dbmodels/page.go Normal file
View File

@@ -0,0 +1,59 @@
package dbmodels
import "github.com/pocketbase/pocketbase/core"
type Page struct {
core.BaseRecordProxy
}
func (p *Page) Key() string {
return p.GetString(KEY_FIELD)
}
func (p *Page) SetKey(key string) {
p.Set(KEY_FIELD, key)
}
func (p *Page) URL() string {
return p.GetString(URL_FIELD)
}
func (p *Page) SetURL(url string) {
p.Set(URL_FIELD, url)
}
func (p *Page) Template() string {
return p.GetString(TEMPLATE_FIELD)
}
func (p *Page) SetTemplate(template string) {
p.Set(TEMPLATE_FIELD, template)
}
func (p *Page) Layout() string {
return p.GetString(LAYOUT_FIELD)
}
func (p *Page) SetLayout(layout string) {
p.Set(LAYOUT_FIELD, layout)
}
func (p *Page) Type() string {
return p.GetString(TYPE_FIELD)
}
func (p *Page) SetType(pageType string) {
p.Set(TYPE_FIELD, pageType)
}
func (p *Page) Data() map[string]interface{} {
val := p.Get(DATA_FIELD)
if val == nil {
return nil
}
return val.(map[string]interface{})
}
func (p *Page) SetData(data map[string]interface{}) {
p.Set(DATA_FIELD, data)
}