Documentation ¶
Overview ¶
Package block is a default implementation of cms block related interfaces declared in "github.com/ottemo/commerce/app/models/csm" package
Index ¶
- Constants
- func APICreateCMSBlock(context api.InterfaceApplicationContext) (interface{}, error)
- func APIDeleteCMSBlock(context api.InterfaceApplicationContext) (interface{}, error)
- func APIGetCMSBlock(context api.InterfaceApplicationContext) (interface{}, error)
- func APIListCMSBlockAttributes(context api.InterfaceApplicationContext) (interface{}, error)
- func APIListCMSBlocks(context api.InterfaceApplicationContext) (interface{}, error)
- func APIUpdateCMSBlock(context api.InterfaceApplicationContext) (interface{}, error)
- type DefaultCMSBlock
- func (it *DefaultCMSBlock) Delete() error
- func (it *DefaultCMSBlock) EvaluateContent() string
- func (it *DefaultCMSBlock) FromHashMap(input map[string]interface{}) error
- func (it *DefaultCMSBlock) Get(attribute string) interface{}
- func (it *DefaultCMSBlock) GetAttributesInfo() []models.StructAttributeInfo
- func (it *DefaultCMSBlock) GetCollection() models.InterfaceCollection
- func (it *DefaultCMSBlock) GetContent() string
- func (it *DefaultCMSBlock) GetID() string
- func (it *DefaultCMSBlock) GetIdentifier() string
- func (it *DefaultCMSBlock) GetImplementationName() string
- func (it *DefaultCMSBlock) GetModelName() string
- func (it *DefaultCMSBlock) Load(id string) error
- func (it *DefaultCMSBlock) LoadByIdentifier(identifier string) error
- func (it *DefaultCMSBlock) New() (models.InterfaceModel, error)
- func (it *DefaultCMSBlock) Save() error
- func (it *DefaultCMSBlock) Set(attribute string, value interface{}) error
- func (it *DefaultCMSBlock) SetContent(newValue string) error
- func (it *DefaultCMSBlock) SetID(newID string) error
- func (it *DefaultCMSBlock) SetIdentifier(newValue string) error
- func (it *DefaultCMSBlock) ToHashMap() map[string]interface{}
- type DefaultCMSBlockCollection
- func (it *DefaultCMSBlockCollection) GetDBCollection() db.InterfaceDBCollection
- func (it *DefaultCMSBlockCollection) GetImplementationName() string
- func (it *DefaultCMSBlockCollection) GetModelName() string
- func (it *DefaultCMSBlockCollection) List() ([]models.StructListItem, error)
- func (it *DefaultCMSBlockCollection) ListAddExtraAttribute(attribute string) error
- func (it *DefaultCMSBlockCollection) ListCMSBlocks() []cms.InterfaceCMSBlock
- func (it *DefaultCMSBlockCollection) ListFilterAdd(Attribute string, Operator string, Value interface{}) error
- func (it *DefaultCMSBlockCollection) ListFilterReset() error
- func (it *DefaultCMSBlockCollection) ListLimit(offset int, limit int) error
- func (it *DefaultCMSBlockCollection) New() (models.InterfaceModel, error)
Constants ¶
const ( ConstCmsBlockCollectionName = "cms_block" ConstErrorModule = "cms/block" ConstErrorLevel = env.ConstErrorLevelActor )
Package global constants
Variables ¶
This section is empty.
Functions ¶
func APICreateCMSBlock ¶
func APICreateCMSBlock(context api.InterfaceApplicationContext) (interface{}, error)
APICreateCMSBlock creates a new CMS block
- CMS block attributes should be specified in request content
func APIDeleteCMSBlock ¶
func APIDeleteCMSBlock(context api.InterfaceApplicationContext) (interface{}, error)
APIDeleteCMSBlock deletes existing CMS block
- CMS block id should be specified in "blockID" argument
func APIGetCMSBlock ¶
func APIGetCMSBlock(context api.InterfaceApplicationContext) (interface{}, error)
APIGetCMSBlock return specified CMS block information
- CMS block id should be specified in "blockID" argument
- CMS block content can be a text template, so "evaluated" field in response is that template evaluation result
func APIListCMSBlockAttributes ¶
func APIListCMSBlockAttributes(context api.InterfaceApplicationContext) (interface{}, error)
APIListCMSBlockAttributes returns a list of CMS block attributes
func APIListCMSBlocks ¶
func APIListCMSBlocks(context api.InterfaceApplicationContext) (interface{}, error)
APIListCMSBlocks returns a list of existing CMS blocks
- if "action" parameter is set to "count" result value will be just a number of list items
func APIUpdateCMSBlock ¶
func APIUpdateCMSBlock(context api.InterfaceApplicationContext) (interface{}, error)
APIUpdateCMSBlock updates existing CMS block
- CMS block id should be specified in "blockID" argument
Types ¶
type DefaultCMSBlock ¶
type DefaultCMSBlock struct { Identifier string Content string CreatedAt time.Time UpdatedAt time.Time // contains filtered or unexported fields }
DefaultCMSBlock is a default implementer of InterfaceCMSBlock
func (*DefaultCMSBlock) Delete ¶
func (it *DefaultCMSBlock) Delete() error
Delete removes current cms block from DB
func (*DefaultCMSBlock) EvaluateContent ¶
func (it *DefaultCMSBlock) EvaluateContent() string
EvaluateContent applying GO text template to content value
func (*DefaultCMSBlock) FromHashMap ¶
func (it *DefaultCMSBlock) FromHashMap(input map[string]interface{}) error
FromHashMap represents object as map[string]interface{}
func (*DefaultCMSBlock) Get ¶
func (it *DefaultCMSBlock) Get(attribute string) interface{}
Get returns object attribute value or nil
func (*DefaultCMSBlock) GetAttributesInfo ¶
func (it *DefaultCMSBlock) GetAttributesInfo() []models.StructAttributeInfo
GetAttributesInfo returns information about object attributes
func (*DefaultCMSBlock) GetCollection ¶
func (it *DefaultCMSBlock) GetCollection() models.InterfaceCollection
GetCollection returns collection of current instance type
func (*DefaultCMSBlock) GetContent ¶
func (it *DefaultCMSBlock) GetContent() string
GetContent returns cms block content
func (*DefaultCMSBlock) GetID ¶
func (it *DefaultCMSBlock) GetID() string
GetID returns id for cms block
func (*DefaultCMSBlock) GetIdentifier ¶
func (it *DefaultCMSBlock) GetIdentifier() string
GetIdentifier returns cms block identifier
func (*DefaultCMSBlock) GetImplementationName ¶
func (it *DefaultCMSBlock) GetImplementationName() string
GetImplementationName returns model implementation name
func (*DefaultCMSBlock) GetModelName ¶
func (it *DefaultCMSBlock) GetModelName() string
GetModelName returns model name
func (*DefaultCMSBlock) Load ¶
func (it *DefaultCMSBlock) Load(id string) error
Load loads cms block information from DB
func (*DefaultCMSBlock) LoadByIdentifier ¶
func (it *DefaultCMSBlock) LoadByIdentifier(identifier string) error
LoadByIdentifier loads data of CMSBlock by its identifier
func (*DefaultCMSBlock) New ¶
func (it *DefaultCMSBlock) New() (models.InterfaceModel, error)
New returns new instance of model implementation object
func (*DefaultCMSBlock) Save ¶
func (it *DefaultCMSBlock) Save() error
Save stores current cms block to DB
func (*DefaultCMSBlock) Set ¶
func (it *DefaultCMSBlock) Set(attribute string, value interface{}) error
Set sets attribute value to object or returns error
func (*DefaultCMSBlock) SetContent ¶
func (it *DefaultCMSBlock) SetContent(newValue string) error
SetContent sets cms block content value
func (*DefaultCMSBlock) SetID ¶
func (it *DefaultCMSBlock) SetID(newID string) error
SetID sets id for cms block
func (*DefaultCMSBlock) SetIdentifier ¶
func (it *DefaultCMSBlock) SetIdentifier(newValue string) error
SetIdentifier sets csm block identifier value
func (*DefaultCMSBlock) ToHashMap ¶
func (it *DefaultCMSBlock) ToHashMap() map[string]interface{}
ToHashMap fills object attributes from map[string]interface{}
type DefaultCMSBlockCollection ¶
type DefaultCMSBlockCollection struct {
// contains filtered or unexported fields
}
DefaultCMSBlockCollection is a default implementer of InterfaceCMSBlockCollection
func (*DefaultCMSBlockCollection) GetDBCollection ¶
func (it *DefaultCMSBlockCollection) GetDBCollection() db.InterfaceDBCollection
GetDBCollection returns database collection
func (*DefaultCMSBlockCollection) GetImplementationName ¶
func (it *DefaultCMSBlockCollection) GetImplementationName() string
GetImplementationName returns model implementation name
func (*DefaultCMSBlockCollection) GetModelName ¶
func (it *DefaultCMSBlockCollection) GetModelName() string
GetModelName returns model name
func (*DefaultCMSBlockCollection) List ¶
func (it *DefaultCMSBlockCollection) List() ([]models.StructListItem, error)
List enumerates items of CMS block model
func (*DefaultCMSBlockCollection) ListAddExtraAttribute ¶
func (it *DefaultCMSBlockCollection) ListAddExtraAttribute(attribute string) error
ListAddExtraAttribute allows to obtain additional attributes from List() function
func (*DefaultCMSBlockCollection) ListCMSBlocks ¶
func (it *DefaultCMSBlockCollection) ListCMSBlocks() []cms.InterfaceCMSBlock
ListCMSBlocks returns list of cms block model items
func (*DefaultCMSBlockCollection) ListFilterAdd ¶
func (it *DefaultCMSBlockCollection) ListFilterAdd(Attribute string, Operator string, Value interface{}) error
ListFilterAdd adds selection filter to List() function
func (*DefaultCMSBlockCollection) ListFilterReset ¶
func (it *DefaultCMSBlockCollection) ListFilterReset() error
ListFilterReset clears presets made by ListFilterAdd() and ListAddExtraAttribute() functions
func (*DefaultCMSBlockCollection) ListLimit ¶
func (it *DefaultCMSBlockCollection) ListLimit(offset int, limit int) error
ListLimit sets select pagination
func (*DefaultCMSBlockCollection) New ¶
func (it *DefaultCMSBlockCollection) New() (models.InterfaceModel, error)
New returns new instance of model implementation object