Documentation ¶
Overview ¶
Package objectref intended to unify and simplify a way of model instance changes tracking (currently not implemented)
Index ¶
- Constants
- type DBObjectRef
- func (it *DBObjectRef) Delete() error
- func (it *DBObjectRef) FromHashMap(input map[string]interface{}) error
- func (it *DBObjectRef) Get(attribute string) interface{}
- func (it *DBObjectRef) GetAttributesInfo() []models.StructAttributeInfo
- func (it *DBObjectRef) GetID() string
- func (it *DBObjectRef) IsLoaded() bool
- func (it *DBObjectRef) IsModified() bool
- func (it *DBObjectRef) Load(id string) error
- func (it *DBObjectRef) MarkAsLoaded()
- func (it *DBObjectRef) MarkAsModified()
- func (it *DBObjectRef) Save() error
- func (it *DBObjectRef) Set(attribute string, value interface{}) error
- func (it *DBObjectRef) SetID(id string)
- func (it *DBObjectRef) ToHashMap() map[string]interface{}
Constants ¶
const ( ConstErrorModule = "objectref" ConstErrorLevel = env.ConstErrorLevelHelper )
Package global constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBObjectRef ¶
type DBObjectRef struct {
// contains filtered or unexported fields
}
DBObjectRef is a object state tracking helper and implementer of InterfaceObject and InterfaceStorable
func (*DBObjectRef) Delete ¶
func (it *DBObjectRef) Delete() error
Delete removes current object instance from DB
func (*DBObjectRef) FromHashMap ¶
func (it *DBObjectRef) FromHashMap(input map[string]interface{}) error
FromHashMap fills attributes values based on provided map
func (*DBObjectRef) Get ¶
func (it *DBObjectRef) Get(attribute string) interface{}
Get returns attribute value for current object or nil if no such attribute
func (*DBObjectRef) GetAttributesInfo ¶
func (it *DBObjectRef) GetAttributesInfo() []models.StructAttributeInfo
GetAttributesInfo returns stub information about current object attributes
- if you using this helper you should rewrite this function in your class
func (*DBObjectRef) IsLoaded ¶
func (it *DBObjectRef) IsLoaded() bool
IsLoaded returns value of load from DB flag
func (*DBObjectRef) IsModified ¶
func (it *DBObjectRef) IsModified() bool
IsModified returns value of modification flag
func (*DBObjectRef) Load ¶
func (it *DBObjectRef) Load(id string) error
Load loads information from DB
func (*DBObjectRef) MarkAsLoaded ¶
func (it *DBObjectRef) MarkAsLoaded()
MarkAsLoaded marks object instance as loaded from DB
func (*DBObjectRef) MarkAsModified ¶
func (it *DBObjectRef) MarkAsModified()
MarkAsModified marks object instance as modified
func (*DBObjectRef) Set ¶
func (it *DBObjectRef) Set(attribute string, value interface{}) error
Set sets attribute value for current object
func (*DBObjectRef) SetID ¶
func (it *DBObjectRef) SetID(id string)
SetID sets new id to current object
func (*DBObjectRef) ToHashMap ¶
func (it *DBObjectRef) ToHashMap() map[string]interface{}
ToHashMap returns attribute values that current object holds