gopress

package module
v0.0.0-...-a1d5674 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2018 License: MIT Imports: 13 Imported by: 0

README

Gopress

Build Status codecov Go Report Card

This is a Golang ActiveRecord implementation of the Wordpress database Schema. This library is automatically generated. If you'd like to contribute, you can change the go files and I will merge them into the generator, or if you're brave you can try to futz with the generator.

I am still figuring out codecov.io which shows less coverage than when local testing, current testing against a database in 75%. Needs improvement - and I'll continue to work on that.

Please see the wiki for details and examples, or look in the testing file. Check out the docs.

The library implements basic CRUD functions (Create/Read(Find)/Update/Delete) and provides structs as "models".

Each model must be provided with an adapter:

type LogFilter func(string, string) string
type Adapter interface {
    Open(string, string, string, string) error
    Close()
    Query(string) ([]map[string]DBValue, error)
    Execute(string) error
    LastInsertedId() int64
    AffectedRows() int64
    DatabasePrefix() string
    LogInfo(string)
    LogError(error)
    LogDebug(string)
    SetLogs(io.Writer)
    SetLogFilter(LogFilter)
    Oops(string) error
    NewDBValue() DBValue
}

An adapter for MySQL is supplied:

type MysqlAdapter struct {
    Host        string `yaml:"host"`
    User        string `yaml:"user"`
    Pass        string `yaml: "pass"`
    Database    string `yaml:"database"`
    DBPrefix    string `yaml:"prefix"`
    _info_log   *log.Logger
    _error_log  *log.Logger
    _debug_log  *log.Logger
    _conn_      *sql.DB
    _lid        int64
    _cnt        int64
    _opened     bool
    _log_filter LogFilter
}

Which provides the required functions, however you can supply your own if you have special needs. The interface is generic enough that you can use it any weird way you want.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Open(string, string, string, string) error
	Close()
	Query(string) ([]map[string]DBValue, error)
	Execute(string) error
	LastInsertedId() int64
	AffectedRows() int64
	DatabasePrefix() string
	LogInfo(string)
	LogError(error)
	LogDebug(string)
	SetLogs(io.Writer)
	SetLogFilter(LogFilter)
	Oops(string) error
	SafeString(string) string
	NewDBValue() DBValue
}

Adapter is the main Database interface which helps to separate the DB from the Models. This is not 100% just yet, and may never be. Eventually the Adapter will probably receive some arguments and a value map and build the Query internally

type Comment

type Comment struct {
	CommentID          int64
	CommentPostID      int64
	CommentAuthor      string
	CommentAuthorEmail string
	CommentAuthorUrl   string
	CommentAuthorIP    string
	CommentDate        *DateTime
	CommentDateGmt     *DateTime
	CommentContent     string
	CommentKarma       int
	CommentApproved    string
	CommentAgent       string
	CommentType        string
	CommentParent      int64
	UserId             int64
	// Dirty markers for smart updates
	IsCommentIDDirty          bool
	IsCommentPostIDDirty      bool
	IsCommentAuthorDirty      bool
	IsCommentAuthorEmailDirty bool
	IsCommentAuthorUrlDirty   bool
	IsCommentAuthorIPDirty    bool
	IsCommentDateDirty        bool
	IsCommentDateGmtDirty     bool
	IsCommentContentDirty     bool
	IsCommentKarmaDirty       bool
	IsCommentApprovedDirty    bool
	IsCommentAgentDirty       bool
	IsCommentTypeDirty        bool
	IsCommentParentDirty      bool
	IsUserIdDirty             bool
	// contains filtered or unexported fields
}

Comment is a Object Relational Mapping to the database table that represents it. In this case it is comments. The table name will be Sprintf'd to include the prefix you define in your YAML configuration for the Adapter.

func NewComment

func NewComment(a Adapter) *Comment

NewComment binds an Adapter to a new instance of Comment and sets up the _table and primary keys

func (*Comment) Create

func (o *Comment) Create() error

Create inserts the model. Calling Save will call this function automatically for new models

func (*Comment) Destroy

func (o *Comment) Destroy() error

Destroy deletes the model

func (*Comment) Find

func (o *Comment) Find(_findByCommentID int64) (bool, error)

Find searchs against the database table field comment_ID and will return bool,error This method is a programatically generated finder for Comment

Note that Find returns a bool of true|false if found or not, not err, in the case of found == true, the instance data will be filled out!

A call to find ALWAYS overwrites the model you call Find on i.e. receiver is a pointer!

```go

m := NewComment(a)
found,err := m.Find(23)
.. handle err
if found == false {
    // handle found
}
... do what you want with m here

```

func (*Comment) FindByCommentAgent

func (o *Comment) FindByCommentAgent(_findByCommentAgent string) ([]*Comment, error)

FindByCommentAgent searchs against the database table field comment_agent and will return []*Comment,error This method is a programatically generated finder for Comment

```go

m := NewComment(a)
results,err := m.FindByCommentAgent(...)
// handle err
for i,r := results {
  // now r is an instance of Comment
}

```

func (*Comment) FindByCommentApproved

func (o *Comment) FindByCommentApproved(_findByCommentApproved string) ([]*Comment, error)

FindByCommentApproved searchs against the database table field comment_approved and will return []*Comment,error This method is a programatically generated finder for Comment

```go

m := NewComment(a)
results,err := m.FindByCommentApproved(...)
// handle err
for i,r := results {
  // now r is an instance of Comment
}

```

func (*Comment) FindByCommentAuthor

func (o *Comment) FindByCommentAuthor(_findByCommentAuthor string) ([]*Comment, error)

FindByCommentAuthor searchs against the database table field comment_author and will return []*Comment,error This method is a programatically generated finder for Comment

```go

m := NewComment(a)
results,err := m.FindByCommentAuthor(...)
// handle err
for i,r := results {
  // now r is an instance of Comment
}

```

func (*Comment) FindByCommentAuthorEmail

func (o *Comment) FindByCommentAuthorEmail(_findByCommentAuthorEmail string) ([]*Comment, error)

FindByCommentAuthorEmail searchs against the database table field comment_author_email and will return []*Comment,error This method is a programatically generated finder for Comment

```go

m := NewComment(a)
results,err := m.FindByCommentAuthorEmail(...)
// handle err
for i,r := results {
  // now r is an instance of Comment
}

```

func (*Comment) FindByCommentAuthorIP

func (o *Comment) FindByCommentAuthorIP(_findByCommentAuthorIP string) ([]*Comment, error)

FindByCommentAuthorIP searchs against the database table field comment_author_IP and will return []*Comment,error This method is a programatically generated finder for Comment

```go

m := NewComment(a)
results,err := m.FindByCommentAuthorIP(...)
// handle err
for i,r := results {
  // now r is an instance of Comment
}

```

func (*Comment) FindByCommentAuthorUrl

func (o *Comment) FindByCommentAuthorUrl(_findByCommentAuthorUrl string) ([]*Comment, error)

FindByCommentAuthorUrl searchs against the database table field comment_author_url and will return []*Comment,error This method is a programatically generated finder for Comment

```go

m := NewComment(a)
results,err := m.FindByCommentAuthorUrl(...)
// handle err
for i,r := results {
  // now r is an instance of Comment
}

```

func (*Comment) FindByCommentContent

func (o *Comment) FindByCommentContent(_findByCommentContent string) ([]*Comment, error)

FindByCommentContent searchs against the database table field comment_content and will return []*Comment,error This method is a programatically generated finder for Comment

```go

m := NewComment(a)
results,err := m.FindByCommentContent(...)
// handle err
for i,r := results {
  // now r is an instance of Comment
}

```

func (*Comment) FindByCommentDate

func (o *Comment) FindByCommentDate(_findByCommentDate *DateTime) ([]*Comment, error)

FindByCommentDate searchs against the database table field comment_date and will return []*Comment,error This method is a programatically generated finder for Comment

```go

m := NewComment(a)
results,err := m.FindByCommentDate(...)
// handle err
for i,r := results {
  // now r is an instance of Comment
}

```

func (*Comment) FindByCommentDateGmt

func (o *Comment) FindByCommentDateGmt(_findByCommentDateGmt *DateTime) ([]*Comment, error)

FindByCommentDateGmt searchs against the database table field comment_date_gmt and will return []*Comment,error This method is a programatically generated finder for Comment

```go

m := NewComment(a)
results,err := m.FindByCommentDateGmt(...)
// handle err
for i,r := results {
  // now r is an instance of Comment
}

```

func (*Comment) FindByCommentKarma

func (o *Comment) FindByCommentKarma(_findByCommentKarma int) ([]*Comment, error)

FindByCommentKarma searchs against the database table field comment_karma and will return []*Comment,error This method is a programatically generated finder for Comment

```go

m := NewComment(a)
results,err := m.FindByCommentKarma(...)
// handle err
for i,r := results {
  // now r is an instance of Comment
}

```

func (*Comment) FindByCommentParent

func (o *Comment) FindByCommentParent(_findByCommentParent int64) ([]*Comment, error)

FindByCommentParent searchs against the database table field comment_parent and will return []*Comment,error This method is a programatically generated finder for Comment

```go

m := NewComment(a)
results,err := m.FindByCommentParent(...)
// handle err
for i,r := results {
  // now r is an instance of Comment
}

```

func (*Comment) FindByCommentPostID

func (o *Comment) FindByCommentPostID(_findByCommentPostID int64) ([]*Comment, error)

FindByCommentPostID searchs against the database table field comment_post_ID and will return []*Comment,error This method is a programatically generated finder for Comment

```go

m := NewComment(a)
results,err := m.FindByCommentPostID(...)
// handle err
for i,r := results {
  // now r is an instance of Comment
}

```

func (*Comment) FindByCommentType

func (o *Comment) FindByCommentType(_findByCommentType string) ([]*Comment, error)

FindByCommentType searchs against the database table field comment_type and will return []*Comment,error This method is a programatically generated finder for Comment

```go

m := NewComment(a)
results,err := m.FindByCommentType(...)
// handle err
for i,r := results {
  // now r is an instance of Comment
}

```

func (*Comment) FindBySQL

func (o *Comment) FindBySQL(s string) ([]*Comment, error)

FindBySQL allows you to search using a complete SQL string

func (*Comment) FindByUserId

func (o *Comment) FindByUserId(_findByUserId int64) ([]*Comment, error)

FindByUserId searchs against the database table field user_id and will return []*Comment,error This method is a programatically generated finder for Comment

```go

m := NewComment(a)
results,err := m.FindByUserId(...)
// handle err
for i,r := results {
  // now r is an instance of Comment
}

```

func (*Comment) FromComment

func (o *Comment) FromComment(m *Comment)

FromComment A kind of Clone function for Comment

func (*Comment) FromDBValueMap

func (o *Comment) FromDBValueMap(m map[string]DBValue) error

FromDBValueMap Converts a DBValueMap returned from Adapter.Query to a Comment

func (*Comment) GetCommentAgent

func (o *Comment) GetCommentAgent() string

GetCommentAgent returns the value of Comment.CommentAgent

func (*Comment) GetCommentApproved

func (o *Comment) GetCommentApproved() string

GetCommentApproved returns the value of Comment.CommentApproved

func (*Comment) GetCommentAuthor

func (o *Comment) GetCommentAuthor() string

GetCommentAuthor returns the value of Comment.CommentAuthor

func (*Comment) GetCommentAuthorEmail

func (o *Comment) GetCommentAuthorEmail() string

GetCommentAuthorEmail returns the value of Comment.CommentAuthorEmail

func (*Comment) GetCommentAuthorIP

func (o *Comment) GetCommentAuthorIP() string

GetCommentAuthorIP returns the value of Comment.CommentAuthorIP

func (*Comment) GetCommentAuthorUrl

func (o *Comment) GetCommentAuthorUrl() string

GetCommentAuthorUrl returns the value of Comment.CommentAuthorUrl

func (*Comment) GetCommentContent

func (o *Comment) GetCommentContent() string

GetCommentContent returns the value of Comment.CommentContent

func (*Comment) GetCommentDate

func (o *Comment) GetCommentDate() *DateTime

GetCommentDate returns the value of Comment.CommentDate

func (*Comment) GetCommentDateGmt

func (o *Comment) GetCommentDateGmt() *DateTime

GetCommentDateGmt returns the value of Comment.CommentDateGmt

func (*Comment) GetCommentID

func (o *Comment) GetCommentID() int64

GetCommentID returns the value of Comment.CommentID

func (*Comment) GetCommentKarma

func (o *Comment) GetCommentKarma() int

GetCommentKarma returns the value of Comment.CommentKarma

func (*Comment) GetCommentParent

func (o *Comment) GetCommentParent() int64

GetCommentParent returns the value of Comment.CommentParent

func (*Comment) GetCommentPostID

func (o *Comment) GetCommentPostID() int64

GetCommentPostID returns the value of Comment.CommentPostID

func (*Comment) GetCommentType

func (o *Comment) GetCommentType() string

GetCommentType returns the value of Comment.CommentType

func (*Comment) GetPrimaryKeyName

func (o *Comment) GetPrimaryKeyName() string

GetPrimaryKeyName returns the DB field name

func (*Comment) GetPrimaryKeyValue

func (o *Comment) GetPrimaryKeyValue() int64

GetPrimaryKeyValue returns the value, usually int64 of the PrimaryKey

func (*Comment) GetUserId

func (o *Comment) GetUserId() int64

GetUserId returns the value of Comment.UserId

func (*Comment) Reload

func (o *Comment) Reload() error

Reload A function to forcibly reload Comment

func (*Comment) Save

func (o *Comment) Save() error

Save is a dynamic saver 'inherited' by all models

func (*Comment) SetCommentAgent

func (o *Comment) SetCommentAgent(arg string)

SetCommentAgent sets and marks as dirty the value of Comment.CommentAgent

func (*Comment) SetCommentApproved

func (o *Comment) SetCommentApproved(arg string)

SetCommentApproved sets and marks as dirty the value of Comment.CommentApproved

func (*Comment) SetCommentAuthor

func (o *Comment) SetCommentAuthor(arg string)

SetCommentAuthor sets and marks as dirty the value of Comment.CommentAuthor

func (*Comment) SetCommentAuthorEmail

func (o *Comment) SetCommentAuthorEmail(arg string)

SetCommentAuthorEmail sets and marks as dirty the value of Comment.CommentAuthorEmail

func (*Comment) SetCommentAuthorIP

func (o *Comment) SetCommentAuthorIP(arg string)

SetCommentAuthorIP sets and marks as dirty the value of Comment.CommentAuthorIP

func (*Comment) SetCommentAuthorUrl

func (o *Comment) SetCommentAuthorUrl(arg string)

SetCommentAuthorUrl sets and marks as dirty the value of Comment.CommentAuthorUrl

func (*Comment) SetCommentContent

func (o *Comment) SetCommentContent(arg string)

SetCommentContent sets and marks as dirty the value of Comment.CommentContent

func (*Comment) SetCommentDate

func (o *Comment) SetCommentDate(arg *DateTime)

SetCommentDate sets and marks as dirty the value of Comment.CommentDate

func (*Comment) SetCommentDateGmt

func (o *Comment) SetCommentDateGmt(arg *DateTime)

SetCommentDateGmt sets and marks as dirty the value of Comment.CommentDateGmt

func (*Comment) SetCommentID

func (o *Comment) SetCommentID(arg int64)

SetCommentID sets and marks as dirty the value of Comment.CommentID

func (*Comment) SetCommentKarma

func (o *Comment) SetCommentKarma(arg int)

SetCommentKarma sets and marks as dirty the value of Comment.CommentKarma

func (*Comment) SetCommentParent

func (o *Comment) SetCommentParent(arg int64)

SetCommentParent sets and marks as dirty the value of Comment.CommentParent

func (*Comment) SetCommentPostID

func (o *Comment) SetCommentPostID(arg int64)

SetCommentPostID sets and marks as dirty the value of Comment.CommentPostID

func (*Comment) SetCommentType

func (o *Comment) SetCommentType(arg string)

SetCommentType sets and marks as dirty the value of Comment.CommentType

func (*Comment) SetUserId

func (o *Comment) SetUserId(arg int64)

SetUserId sets and marks as dirty the value of Comment.UserId

func (*Comment) Update

func (o *Comment) Update() error

Update is a dynamic updater, it considers whether or not a field is 'dirty' and needs to be updated. Will only work if you use the Getters and Setters

func (*Comment) UpdateCommentAgent

func (o *Comment) UpdateCommentAgent(_updCommentAgent string) (int64, error)

UpdateCommentAgent an immediate DB Query to update a single column, in this case comment_agent

func (*Comment) UpdateCommentApproved

func (o *Comment) UpdateCommentApproved(_updCommentApproved string) (int64, error)

UpdateCommentApproved an immediate DB Query to update a single column, in this case comment_approved

func (*Comment) UpdateCommentAuthor

func (o *Comment) UpdateCommentAuthor(_updCommentAuthor string) (int64, error)

UpdateCommentAuthor an immediate DB Query to update a single column, in this case comment_author

func (*Comment) UpdateCommentAuthorEmail

func (o *Comment) UpdateCommentAuthorEmail(_updCommentAuthorEmail string) (int64, error)

UpdateCommentAuthorEmail an immediate DB Query to update a single column, in this case comment_author_email

func (*Comment) UpdateCommentAuthorIP

func (o *Comment) UpdateCommentAuthorIP(_updCommentAuthorIP string) (int64, error)

UpdateCommentAuthorIP an immediate DB Query to update a single column, in this case comment_author_IP

func (*Comment) UpdateCommentAuthorUrl

func (o *Comment) UpdateCommentAuthorUrl(_updCommentAuthorUrl string) (int64, error)

UpdateCommentAuthorUrl an immediate DB Query to update a single column, in this case comment_author_url

func (*Comment) UpdateCommentContent

func (o *Comment) UpdateCommentContent(_updCommentContent string) (int64, error)

UpdateCommentContent an immediate DB Query to update a single column, in this case comment_content

func (*Comment) UpdateCommentDate

func (o *Comment) UpdateCommentDate(_updCommentDate *DateTime) (int64, error)

UpdateCommentDate an immediate DB Query to update a single column, in this case comment_date

func (*Comment) UpdateCommentDateGmt

func (o *Comment) UpdateCommentDateGmt(_updCommentDateGmt *DateTime) (int64, error)

UpdateCommentDateGmt an immediate DB Query to update a single column, in this case comment_date_gmt

func (*Comment) UpdateCommentKarma

func (o *Comment) UpdateCommentKarma(_updCommentKarma int) (int64, error)

UpdateCommentKarma an immediate DB Query to update a single column, in this case comment_karma

func (*Comment) UpdateCommentParent

func (o *Comment) UpdateCommentParent(_updCommentParent int64) (int64, error)

UpdateCommentParent an immediate DB Query to update a single column, in this case comment_parent

func (*Comment) UpdateCommentPostID

func (o *Comment) UpdateCommentPostID(_updCommentPostID int64) (int64, error)

UpdateCommentPostID an immediate DB Query to update a single column, in this case comment_post_ID

func (*Comment) UpdateCommentType

func (o *Comment) UpdateCommentType(_updCommentType string) (int64, error)

UpdateCommentType an immediate DB Query to update a single column, in this case comment_type

func (*Comment) UpdateUserId

func (o *Comment) UpdateUserId(_updUserId int64) (int64, error)

UpdateUserId an immediate DB Query to update a single column, in this case user_id

func (*Comment) Where

func (o *Comment) Where(s string) ([]*Comment, error)

Where is a shortcut to FindBySql, in this case you only specify the WHERE clause, such as m.Where(`ID IN (23,25)`)

type CommentMeta

type CommentMeta struct {
	MetaId    int64
	CommentId int64
	MetaKey   string
	MetaValue string
	// Dirty markers for smart updates
	IsMetaIdDirty    bool
	IsCommentIdDirty bool
	IsMetaKeyDirty   bool
	IsMetaValueDirty bool
	// contains filtered or unexported fields
}

CommentMeta is a Object Relational Mapping to the database table that represents it. In this case it is commentmeta. The table name will be Sprintf'd to include the prefix you define in your YAML configuration for the Adapter.

func NewCommentMeta

func NewCommentMeta(a Adapter) *CommentMeta

NewCommentMeta binds an Adapter to a new instance of CommentMeta and sets up the _table and primary keys

func (*CommentMeta) Create

func (o *CommentMeta) Create() error

Create inserts the model. Calling Save will call this function automatically for new models

func (*CommentMeta) Destroy

func (o *CommentMeta) Destroy() error

Destroy deletes the model

func (*CommentMeta) Find

func (o *CommentMeta) Find(_findByMetaId int64) (bool, error)

Find searchs against the database table field meta_id and will return bool,error This method is a programatically generated finder for CommentMeta

Note that Find returns a bool of true|false if found or not, not err, in the case of found == true, the instance data will be filled out!

A call to find ALWAYS overwrites the model you call Find on i.e. receiver is a pointer!

```go

m := NewCommentMeta(a)
found,err := m.Find(23)
.. handle err
if found == false {
    // handle found
}
... do what you want with m here

```

func (*CommentMeta) FindByCommentId

func (o *CommentMeta) FindByCommentId(_findByCommentId int64) ([]*CommentMeta, error)

FindByCommentId searchs against the database table field comment_id and will return []*CommentMeta,error This method is a programatically generated finder for CommentMeta

```go

m := NewCommentMeta(a)
results,err := m.FindByCommentId(...)
// handle err
for i,r := results {
  // now r is an instance of CommentMeta
}

```

func (*CommentMeta) FindByMetaKey

func (o *CommentMeta) FindByMetaKey(_findByMetaKey string) ([]*CommentMeta, error)

FindByMetaKey searchs against the database table field meta_key and will return []*CommentMeta,error This method is a programatically generated finder for CommentMeta

```go

m := NewCommentMeta(a)
results,err := m.FindByMetaKey(...)
// handle err
for i,r := results {
  // now r is an instance of CommentMeta
}

```

func (*CommentMeta) FindByMetaValue

func (o *CommentMeta) FindByMetaValue(_findByMetaValue string) ([]*CommentMeta, error)

FindByMetaValue searchs against the database table field meta_value and will return []*CommentMeta,error This method is a programatically generated finder for CommentMeta

```go

m := NewCommentMeta(a)
results,err := m.FindByMetaValue(...)
// handle err
for i,r := results {
  // now r is an instance of CommentMeta
}

```

func (*CommentMeta) FindBySQL

func (o *CommentMeta) FindBySQL(s string) ([]*CommentMeta, error)

FindBySQL allows you to search using a complete SQL string

func (*CommentMeta) FromCommentMeta

func (o *CommentMeta) FromCommentMeta(m *CommentMeta)

FromCommentMeta A kind of Clone function for CommentMeta

func (*CommentMeta) FromDBValueMap

func (o *CommentMeta) FromDBValueMap(m map[string]DBValue) error

FromDBValueMap Converts a DBValueMap returned from Adapter.Query to a CommentMeta

func (*CommentMeta) GetCommentId

func (o *CommentMeta) GetCommentId() int64

GetCommentId returns the value of CommentMeta.CommentId

func (*CommentMeta) GetMetaId

func (o *CommentMeta) GetMetaId() int64

GetMetaId returns the value of CommentMeta.MetaId

func (*CommentMeta) GetMetaKey

func (o *CommentMeta) GetMetaKey() string

GetMetaKey returns the value of CommentMeta.MetaKey

func (*CommentMeta) GetMetaValue

func (o *CommentMeta) GetMetaValue() string

GetMetaValue returns the value of CommentMeta.MetaValue

func (*CommentMeta) GetPrimaryKeyName

func (o *CommentMeta) GetPrimaryKeyName() string

GetPrimaryKeyName returns the DB field name

func (*CommentMeta) GetPrimaryKeyValue

func (o *CommentMeta) GetPrimaryKeyValue() int64

GetPrimaryKeyValue returns the value, usually int64 of the PrimaryKey

func (*CommentMeta) Reload

func (o *CommentMeta) Reload() error

Reload A function to forcibly reload CommentMeta

func (*CommentMeta) Save

func (o *CommentMeta) Save() error

Save is a dynamic saver 'inherited' by all models

func (*CommentMeta) SetCommentId

func (o *CommentMeta) SetCommentId(arg int64)

SetCommentId sets and marks as dirty the value of CommentMeta.CommentId

func (*CommentMeta) SetMetaId

func (o *CommentMeta) SetMetaId(arg int64)

SetMetaId sets and marks as dirty the value of CommentMeta.MetaId

func (*CommentMeta) SetMetaKey

func (o *CommentMeta) SetMetaKey(arg string)

SetMetaKey sets and marks as dirty the value of CommentMeta.MetaKey

func (*CommentMeta) SetMetaValue

func (o *CommentMeta) SetMetaValue(arg string)

SetMetaValue sets and marks as dirty the value of CommentMeta.MetaValue

func (*CommentMeta) Update

func (o *CommentMeta) Update() error

Update is a dynamic updater, it considers whether or not a field is 'dirty' and needs to be updated. Will only work if you use the Getters and Setters

func (*CommentMeta) UpdateCommentId

func (o *CommentMeta) UpdateCommentId(_updCommentId int64) (int64, error)

UpdateCommentId an immediate DB Query to update a single column, in this case comment_id

func (*CommentMeta) UpdateMetaKey

func (o *CommentMeta) UpdateMetaKey(_updMetaKey string) (int64, error)

UpdateMetaKey an immediate DB Query to update a single column, in this case meta_key

func (*CommentMeta) UpdateMetaValue

func (o *CommentMeta) UpdateMetaValue(_updMetaValue string) (int64, error)

UpdateMetaValue an immediate DB Query to update a single column, in this case meta_value

func (*CommentMeta) Where

func (o *CommentMeta) Where(s string) ([]*CommentMeta, error)

Where is a shortcut to FindBySql, in this case you only specify the WHERE clause, such as m.Where(`ID IN (23,25)`)

type DBValue

type DBValue interface {
	AsInt() (int, error)
	AsInt32() (int32, error)
	AsInt64() (int64, error)
	AsFloat32() (float32, error)
	AsFloat64() (float64, error)
	AsString() (string, error)
	AsDateTime() (*DateTime, error)
	SetInternalValue(string, string)
}

DBValue Provides a tidy way to convert string values from the DB into go values

type DateTime

type DateTime struct {
	// The day as an int
	Day int
	// the month, as an int
	Month int
	// The year, as an int
	Year int
	// the hours, in 24 hour format
	Hours int
	// the minutes
	Minutes int
	// the seconds
	Seconds int
	// contains filtered or unexported fields
}

DateTime A simple struct to represent DateTime fields

func NewDateTime

func NewDateTime(a Adapter) *DateTime

NewDateTime Returns a basic DateTime value

func (*DateTime) FromString

func (d *DateTime) FromString(s string) error

FromString Converts a string like 0000-00-00 00:00:00 into a DateTime

func (*DateTime) String

func (d *DateTime) String() string

String The Stringer for DateTime to avoid having to call ToString all the time.

func (*DateTime) ToString

func (d *DateTime) ToString() string

ToString For backwards compat... Never use this, use String() instead.

type Link struct {
	LinkId          int64
	LinkUrl         string
	LinkName        string
	LinkImage       string
	LinkTarget      string
	LinkDescription string
	LinkVisible     string
	LinkOwner       int64
	LinkRating      int
	LinkUpdated     *DateTime
	LinkRel         string
	LinkNotes       string
	LinkRss         string
	// Dirty markers for smart updates
	IsLinkIdDirty          bool
	IsLinkUrlDirty         bool
	IsLinkNameDirty        bool
	IsLinkImageDirty       bool
	IsLinkTargetDirty      bool
	IsLinkDescriptionDirty bool
	IsLinkVisibleDirty     bool
	IsLinkOwnerDirty       bool
	IsLinkRatingDirty      bool
	IsLinkUpdatedDirty     bool
	IsLinkRelDirty         bool
	IsLinkNotesDirty       bool
	IsLinkRssDirty         bool
	// contains filtered or unexported fields
}

Link is a Object Relational Mapping to the database table that represents it. In this case it is links. The table name will be Sprintf'd to include the prefix you define in your YAML configuration for the Adapter.

func NewLink(a Adapter) *Link

NewLink binds an Adapter to a new instance of Link and sets up the _table and primary keys

func (*Link) Create

func (o *Link) Create() error

Create inserts the model. Calling Save will call this function automatically for new models

func (*Link) Destroy

func (o *Link) Destroy() error

Destroy deletes the model

func (*Link) Find

func (o *Link) Find(_findByLinkId int64) (bool, error)

Find searchs against the database table field link_id and will return bool,error This method is a programatically generated finder for Link

Note that Find returns a bool of true|false if found or not, not err, in the case of found == true, the instance data will be filled out!

A call to find ALWAYS overwrites the model you call Find on i.e. receiver is a pointer!

```go

m := NewLink(a)
found,err := m.Find(23)
.. handle err
if found == false {
    // handle found
}
... do what you want with m here

```

func (*Link) FindByLinkDescription

func (o *Link) FindByLinkDescription(_findByLinkDescription string) ([]*Link, error)

FindByLinkDescription searchs against the database table field link_description and will return []*Link,error This method is a programatically generated finder for Link

```go

m := NewLink(a)
results,err := m.FindByLinkDescription(...)
// handle err
for i,r := results {
  // now r is an instance of Link
}

```

func (*Link) FindByLinkImage

func (o *Link) FindByLinkImage(_findByLinkImage string) ([]*Link, error)

FindByLinkImage searchs against the database table field link_image and will return []*Link,error This method is a programatically generated finder for Link

```go

m := NewLink(a)
results,err := m.FindByLinkImage(...)
// handle err
for i,r := results {
  // now r is an instance of Link
}

```

func (*Link) FindByLinkName

func (o *Link) FindByLinkName(_findByLinkName string) ([]*Link, error)

FindByLinkName searchs against the database table field link_name and will return []*Link,error This method is a programatically generated finder for Link

```go

m := NewLink(a)
results,err := m.FindByLinkName(...)
// handle err
for i,r := results {
  // now r is an instance of Link
}

```

func (*Link) FindByLinkNotes

func (o *Link) FindByLinkNotes(_findByLinkNotes string) ([]*Link, error)

FindByLinkNotes searchs against the database table field link_notes and will return []*Link,error This method is a programatically generated finder for Link

```go

m := NewLink(a)
results,err := m.FindByLinkNotes(...)
// handle err
for i,r := results {
  // now r is an instance of Link
}

```

func (*Link) FindByLinkOwner

func (o *Link) FindByLinkOwner(_findByLinkOwner int64) ([]*Link, error)

FindByLinkOwner searchs against the database table field link_owner and will return []*Link,error This method is a programatically generated finder for Link

```go

m := NewLink(a)
results,err := m.FindByLinkOwner(...)
// handle err
for i,r := results {
  // now r is an instance of Link
}

```

func (*Link) FindByLinkRating

func (o *Link) FindByLinkRating(_findByLinkRating int) ([]*Link, error)

FindByLinkRating searchs against the database table field link_rating and will return []*Link,error This method is a programatically generated finder for Link

```go

m := NewLink(a)
results,err := m.FindByLinkRating(...)
// handle err
for i,r := results {
  // now r is an instance of Link
}

```

func (*Link) FindByLinkRel

func (o *Link) FindByLinkRel(_findByLinkRel string) ([]*Link, error)

FindByLinkRel searchs against the database table field link_rel and will return []*Link,error This method is a programatically generated finder for Link

```go

m := NewLink(a)
results,err := m.FindByLinkRel(...)
// handle err
for i,r := results {
  // now r is an instance of Link
}

```

func (*Link) FindByLinkRss

func (o *Link) FindByLinkRss(_findByLinkRss string) ([]*Link, error)

FindByLinkRss searchs against the database table field link_rss and will return []*Link,error This method is a programatically generated finder for Link

```go

m := NewLink(a)
results,err := m.FindByLinkRss(...)
// handle err
for i,r := results {
  // now r is an instance of Link
}

```

func (*Link) FindByLinkTarget

func (o *Link) FindByLinkTarget(_findByLinkTarget string) ([]*Link, error)

FindByLinkTarget searchs against the database table field link_target and will return []*Link,error This method is a programatically generated finder for Link

```go

m := NewLink(a)
results,err := m.FindByLinkTarget(...)
// handle err
for i,r := results {
  // now r is an instance of Link
}

```

func (*Link) FindByLinkUpdated

func (o *Link) FindByLinkUpdated(_findByLinkUpdated *DateTime) ([]*Link, error)

FindByLinkUpdated searchs against the database table field link_updated and will return []*Link,error This method is a programatically generated finder for Link

```go

m := NewLink(a)
results,err := m.FindByLinkUpdated(...)
// handle err
for i,r := results {
  // now r is an instance of Link
}

```

func (*Link) FindByLinkUrl

func (o *Link) FindByLinkUrl(_findByLinkUrl string) ([]*Link, error)

FindByLinkUrl searchs against the database table field link_url and will return []*Link,error This method is a programatically generated finder for Link

```go

m := NewLink(a)
results,err := m.FindByLinkUrl(...)
// handle err
for i,r := results {
  // now r is an instance of Link
}

```

func (*Link) FindByLinkVisible

func (o *Link) FindByLinkVisible(_findByLinkVisible string) ([]*Link, error)

FindByLinkVisible searchs against the database table field link_visible and will return []*Link,error This method is a programatically generated finder for Link

```go

m := NewLink(a)
results,err := m.FindByLinkVisible(...)
// handle err
for i,r := results {
  // now r is an instance of Link
}

```

func (*Link) FindBySQL

func (o *Link) FindBySQL(s string) ([]*Link, error)

FindBySQL allows you to search using a complete SQL string

func (*Link) FromDBValueMap

func (o *Link) FromDBValueMap(m map[string]DBValue) error

FromDBValueMap Converts a DBValueMap returned from Adapter.Query to a Link

func (o *Link) FromLink(m *Link)

FromLink A kind of Clone function for Link

func (*Link) GetLinkDescription

func (o *Link) GetLinkDescription() string

GetLinkDescription returns the value of Link.LinkDescription

func (*Link) GetLinkId

func (o *Link) GetLinkId() int64

GetLinkId returns the value of Link.LinkId

func (*Link) GetLinkImage

func (o *Link) GetLinkImage() string

GetLinkImage returns the value of Link.LinkImage

func (*Link) GetLinkName

func (o *Link) GetLinkName() string

GetLinkName returns the value of Link.LinkName

func (*Link) GetLinkNotes

func (o *Link) GetLinkNotes() string

GetLinkNotes returns the value of Link.LinkNotes

func (*Link) GetLinkOwner

func (o *Link) GetLinkOwner() int64

GetLinkOwner returns the value of Link.LinkOwner

func (*Link) GetLinkRating

func (o *Link) GetLinkRating() int

GetLinkRating returns the value of Link.LinkRating

func (*Link) GetLinkRel

func (o *Link) GetLinkRel() string

GetLinkRel returns the value of Link.LinkRel

func (*Link) GetLinkRss

func (o *Link) GetLinkRss() string

GetLinkRss returns the value of Link.LinkRss

func (*Link) GetLinkTarget

func (o *Link) GetLinkTarget() string

GetLinkTarget returns the value of Link.LinkTarget

func (*Link) GetLinkUpdated

func (o *Link) GetLinkUpdated() *DateTime

GetLinkUpdated returns the value of Link.LinkUpdated

func (*Link) GetLinkUrl

func (o *Link) GetLinkUrl() string

GetLinkUrl returns the value of Link.LinkUrl

func (*Link) GetLinkVisible

func (o *Link) GetLinkVisible() string

GetLinkVisible returns the value of Link.LinkVisible

func (*Link) GetPrimaryKeyName

func (o *Link) GetPrimaryKeyName() string

GetPrimaryKeyName returns the DB field name

func (*Link) GetPrimaryKeyValue

func (o *Link) GetPrimaryKeyValue() int64

GetPrimaryKeyValue returns the value, usually int64 of the PrimaryKey

func (*Link) Reload

func (o *Link) Reload() error

Reload A function to forcibly reload Link

func (*Link) Save

func (o *Link) Save() error

Save is a dynamic saver 'inherited' by all models

func (*Link) SetLinkDescription

func (o *Link) SetLinkDescription(arg string)

SetLinkDescription sets and marks as dirty the value of Link.LinkDescription

func (*Link) SetLinkId

func (o *Link) SetLinkId(arg int64)

SetLinkId sets and marks as dirty the value of Link.LinkId

func (*Link) SetLinkImage

func (o *Link) SetLinkImage(arg string)

SetLinkImage sets and marks as dirty the value of Link.LinkImage

func (*Link) SetLinkName

func (o *Link) SetLinkName(arg string)

SetLinkName sets and marks as dirty the value of Link.LinkName

func (*Link) SetLinkNotes

func (o *Link) SetLinkNotes(arg string)

SetLinkNotes sets and marks as dirty the value of Link.LinkNotes

func (*Link) SetLinkOwner

func (o *Link) SetLinkOwner(arg int64)

SetLinkOwner sets and marks as dirty the value of Link.LinkOwner

func (*Link) SetLinkRating

func (o *Link) SetLinkRating(arg int)

SetLinkRating sets and marks as dirty the value of Link.LinkRating

func (*Link) SetLinkRel

func (o *Link) SetLinkRel(arg string)

SetLinkRel sets and marks as dirty the value of Link.LinkRel

func (*Link) SetLinkRss

func (o *Link) SetLinkRss(arg string)

SetLinkRss sets and marks as dirty the value of Link.LinkRss

func (*Link) SetLinkTarget

func (o *Link) SetLinkTarget(arg string)

SetLinkTarget sets and marks as dirty the value of Link.LinkTarget

func (*Link) SetLinkUpdated

func (o *Link) SetLinkUpdated(arg *DateTime)

SetLinkUpdated sets and marks as dirty the value of Link.LinkUpdated

func (*Link) SetLinkUrl

func (o *Link) SetLinkUrl(arg string)

SetLinkUrl sets and marks as dirty the value of Link.LinkUrl

func (*Link) SetLinkVisible

func (o *Link) SetLinkVisible(arg string)

SetLinkVisible sets and marks as dirty the value of Link.LinkVisible

func (*Link) Update

func (o *Link) Update() error

Update is a dynamic updater, it considers whether or not a field is 'dirty' and needs to be updated. Will only work if you use the Getters and Setters

func (*Link) UpdateLinkDescription

func (o *Link) UpdateLinkDescription(_updLinkDescription string) (int64, error)

UpdateLinkDescription an immediate DB Query to update a single column, in this case link_description

func (*Link) UpdateLinkImage

func (o *Link) UpdateLinkImage(_updLinkImage string) (int64, error)

UpdateLinkImage an immediate DB Query to update a single column, in this case link_image

func (*Link) UpdateLinkName

func (o *Link) UpdateLinkName(_updLinkName string) (int64, error)

UpdateLinkName an immediate DB Query to update a single column, in this case link_name

func (*Link) UpdateLinkNotes

func (o *Link) UpdateLinkNotes(_updLinkNotes string) (int64, error)

UpdateLinkNotes an immediate DB Query to update a single column, in this case link_notes

func (*Link) UpdateLinkOwner

func (o *Link) UpdateLinkOwner(_updLinkOwner int64) (int64, error)

UpdateLinkOwner an immediate DB Query to update a single column, in this case link_owner

func (*Link) UpdateLinkRating

func (o *Link) UpdateLinkRating(_updLinkRating int) (int64, error)

UpdateLinkRating an immediate DB Query to update a single column, in this case link_rating

func (*Link) UpdateLinkRel

func (o *Link) UpdateLinkRel(_updLinkRel string) (int64, error)

UpdateLinkRel an immediate DB Query to update a single column, in this case link_rel

func (*Link) UpdateLinkRss

func (o *Link) UpdateLinkRss(_updLinkRss string) (int64, error)

UpdateLinkRss an immediate DB Query to update a single column, in this case link_rss

func (*Link) UpdateLinkTarget

func (o *Link) UpdateLinkTarget(_updLinkTarget string) (int64, error)

UpdateLinkTarget an immediate DB Query to update a single column, in this case link_target

func (*Link) UpdateLinkUpdated

func (o *Link) UpdateLinkUpdated(_updLinkUpdated *DateTime) (int64, error)

UpdateLinkUpdated an immediate DB Query to update a single column, in this case link_updated

func (*Link) UpdateLinkUrl

func (o *Link) UpdateLinkUrl(_updLinkUrl string) (int64, error)

UpdateLinkUrl an immediate DB Query to update a single column, in this case link_url

func (*Link) UpdateLinkVisible

func (o *Link) UpdateLinkVisible(_updLinkVisible string) (int64, error)

UpdateLinkVisible an immediate DB Query to update a single column, in this case link_visible

func (*Link) Where

func (o *Link) Where(s string) ([]*Link, error)

Where is a shortcut to FindBySql, in this case you only specify the WHERE clause, such as m.Where(`ID IN (23,25)`)

type LogFilter

type LogFilter func(string, string) string

LogFilter is an anonymous function that that receives the log tag and string and allows you to filter out extraneous lines when trying to find bugs.

type MysqlAdapter

type MysqlAdapter struct {
	// The host, localhost is valid here, or 127.0.0.1
	// if you use localhost, the system won't use TCP
	Host string `yaml:"host"`
	// The database username
	User string `yaml:"user"`
	// The database password
	Pass string `yaml:"pass"`
	// The database name
	Database string `yaml:"database"`
	// A prefix, if any - can be blank
	DBPrefix string `yaml:"prefix"`
	// contains filtered or unexported fields
}

MysqlAdapter is the MySql implementation

func NewMysqlAdapter

func NewMysqlAdapter(pre string) *MysqlAdapter

NewMysqlAdapter returns a pointer to MysqlAdapter

func NewMysqlAdapterEx

func NewMysqlAdapterEx(fname string) (*MysqlAdapter, error)

NewMysqlAdapterEx sets everything up based on your YAML config Args: fname is a string path to a YAML config file This function will attempt to Open the database defined in that file. Example file:

host: "localhost"
user: "dbuser"
pass: "dbuserpass"
database: "my_db"
prefix: "wp_"

func (*MysqlAdapter) AffectedRows

func (a *MysqlAdapter) AffectedRows() int64

AffectedRows Grab the number of AffectedRows

func (*MysqlAdapter) Close

func (a *MysqlAdapter) Close()

Close This should be called in your application with a defer a.Close() or something similar. Closing is not automatic!

func (*MysqlAdapter) DatabasePrefix

func (a *MysqlAdapter) DatabasePrefix() string

DatabasePrefix Get the DatabasePrefix from the Adapter

func (*MysqlAdapter) Execute

func (a *MysqlAdapter) Execute(q string) error

Execute For UPDATE and INSERT calls, i.e. nothing that returns a result set.

func (*MysqlAdapter) FromYAML

func (a *MysqlAdapter) FromYAML(b []byte) error

FromYAML Set the Adapter's members from a YAML file

func (*MysqlAdapter) LastInsertedId

func (a *MysqlAdapter) LastInsertedId() int64

LastInsertedId Grab the last auto_incremented id

func (*MysqlAdapter) LogDebug

func (a *MysqlAdapter) LogDebug(s string)

LogDebug Tags the string with DEBUG and puts it into _debugLog.

func (*MysqlAdapter) LogError

func (a *MysqlAdapter) LogError(s error)

LogError Tags the string with ERROR and puts it into _errorLog.

func (*MysqlAdapter) LogInfo

func (a *MysqlAdapter) LogInfo(s string)

LogInfo Tags the string with INFO and puts it into _infoLog.

func (*MysqlAdapter) NewDBValue

func (a *MysqlAdapter) NewDBValue() DBValue

NewDBValue Creates a new DBValue, mostly used internally, but you may wish to use it in special circumstances.

func (*MysqlAdapter) Oops

func (a *MysqlAdapter) Oops(s string) error

Oops A function for catching errors generated by the library and funneling them to the log files

func (*MysqlAdapter) Open

func (a *MysqlAdapter) Open(h, u, p, d string) error

Open Opens the database connection. Be sure to use a.Close() as closing is NOT handled for you.

func (*MysqlAdapter) Query

func (a *MysqlAdapter) Query(q string) ([]map[string]DBValue, error)

Query The generay Query function, i.e. SQL that returns results, as opposed to an INSERT or UPDATE which uses Execute.

func (*MysqlAdapter) SafeString

func (a *MysqlAdapter) SafeString(s string) string

SafeString Not implemented yet, but soon.

func (*MysqlAdapter) SetDebugLog

func (a *MysqlAdapter) SetDebugLog(t io.Writer)

SetDebugLog Sets the _debugLog to the io.Writer, use ioutil.Discard if you don't want this one at all.

func (*MysqlAdapter) SetErrorLog

func (a *MysqlAdapter) SetErrorLog(t io.Writer)

SetErrorLog Sets the _errorLog to the io.Writer, use ioutil.Discard if you don't want this one at all.

func (*MysqlAdapter) SetInfoLog

func (a *MysqlAdapter) SetInfoLog(t io.Writer)

SetInfoLog Sets the _infoLog to the io.Writer, use ioutil.Discard if you don't want this one at all.

func (*MysqlAdapter) SetLogFilter

func (a *MysqlAdapter) SetLogFilter(f LogFilter)

SetLogFilter sets the LogFilter to a function. This is only useful if you are debugging, or you want to reformat the log data.

func (*MysqlAdapter) SetLogs

func (a *MysqlAdapter) SetLogs(t io.Writer)

SetLogs Sets ALL logs to the io.Writer, use ioutil.Discard if you don't want this one at all.

type MysqlValue

type MysqlValue struct {
	// contains filtered or unexported fields
}

MysqlValue Implements DBValue for MySQL, you'll generally not interact directly with this type, but it is there for special cases.

func NewMysqlValue

func NewMysqlValue(a Adapter) *MysqlValue

NewMysqlValue A function for largely internal use, but basically in order to use a DBValue, it needs to have its Adapter setup, this is because some values have Adapter specific issues. The implementing adapter may need to provide some information, or logging etc

func (*MysqlValue) AsDateTime

func (v *MysqlValue) AsDateTime() (*DateTime, error)

AsDateTime Tries to convert the string to a DateTime, parsing may fail.

func (*MysqlValue) AsFloat32

func (v *MysqlValue) AsFloat32() (float32, error)

AsFloat32 Tries to convert the internal string to a float32

func (*MysqlValue) AsFloat64

func (v *MysqlValue) AsFloat64() (float64, error)

AsFloat64 Tries to convert the internal string to a float64

func (*MysqlValue) AsInt

func (v *MysqlValue) AsInt() (int, error)

AsInt Attempts to convert the internal string to an Int

func (*MysqlValue) AsInt32

func (v *MysqlValue) AsInt32() (int32, error)

AsInt32 Tries to convert the internal string to an int32

func (*MysqlValue) AsInt64

func (v *MysqlValue) AsInt64() (int64, error)

AsInt64 Tries to convert the internal string to an int64 (i.e. BIGINT)

func (*MysqlValue) AsString

func (v *MysqlValue) AsString() (string, error)

AsString Simply returns the internal string representation.

func (*MysqlValue) SetInternalValue

func (v *MysqlValue) SetInternalValue(key, value string)

SetInternalValue Sets the internal value of the DBValue to the string provided. key isn't really used, but it may be.

type Option

type Option struct {
	OptionId    int64
	OptionName  string
	OptionValue string
	Autoload    string
	// Dirty markers for smart updates
	IsOptionIdDirty    bool
	IsOptionNameDirty  bool
	IsOptionValueDirty bool
	IsAutoloadDirty    bool
	// contains filtered or unexported fields
}

Option is a Object Relational Mapping to the database table that represents it. In this case it is options. The table name will be Sprintf'd to include the prefix you define in your YAML configuration for the Adapter.

func NewOption

func NewOption(a Adapter) *Option

NewOption binds an Adapter to a new instance of Option and sets up the _table and primary keys

func (*Option) Create

func (o *Option) Create() error

Create inserts the model. Calling Save will call this function automatically for new models

func (*Option) Destroy

func (o *Option) Destroy() error

Destroy deletes the model

func (*Option) Find

func (o *Option) Find(_findByOptionId int64) (bool, error)

Find searchs against the database table field option_id and will return bool,error This method is a programatically generated finder for Option

Note that Find returns a bool of true|false if found or not, not err, in the case of found == true, the instance data will be filled out!

A call to find ALWAYS overwrites the model you call Find on i.e. receiver is a pointer!

```go

m := NewOption(a)
found,err := m.Find(23)
.. handle err
if found == false {
    // handle found
}
... do what you want with m here

```

func (*Option) FindByAutoload

func (o *Option) FindByAutoload(_findByAutoload string) ([]*Option, error)

FindByAutoload searchs against the database table field autoload and will return []*Option,error This method is a programatically generated finder for Option

```go

m := NewOption(a)
results,err := m.FindByAutoload(...)
// handle err
for i,r := results {
  // now r is an instance of Option
}

```

func (*Option) FindByOptionName

func (o *Option) FindByOptionName(_findByOptionName string) ([]*Option, error)

FindByOptionName searchs against the database table field option_name and will return []*Option,error This method is a programatically generated finder for Option

```go

m := NewOption(a)
results,err := m.FindByOptionName(...)
// handle err
for i,r := results {
  // now r is an instance of Option
}

```

func (*Option) FindByOptionValue

func (o *Option) FindByOptionValue(_findByOptionValue string) ([]*Option, error)

FindByOptionValue searchs against the database table field option_value and will return []*Option,error This method is a programatically generated finder for Option

```go

m := NewOption(a)
results,err := m.FindByOptionValue(...)
// handle err
for i,r := results {
  // now r is an instance of Option
}

```

func (*Option) FindBySQL

func (o *Option) FindBySQL(s string) ([]*Option, error)

FindBySQL allows you to search using a complete SQL string

func (*Option) FromDBValueMap

func (o *Option) FromDBValueMap(m map[string]DBValue) error

FromDBValueMap Converts a DBValueMap returned from Adapter.Query to a Option

func (*Option) FromOption

func (o *Option) FromOption(m *Option)

FromOption A kind of Clone function for Option

func (*Option) GetAutoload

func (o *Option) GetAutoload() string

GetAutoload returns the value of Option.Autoload

func (*Option) GetOptionId

func (o *Option) GetOptionId() int64

GetOptionId returns the value of Option.OptionId

func (*Option) GetOptionName

func (o *Option) GetOptionName() string

GetOptionName returns the value of Option.OptionName

func (*Option) GetOptionValue

func (o *Option) GetOptionValue() string

GetOptionValue returns the value of Option.OptionValue

func (*Option) GetPrimaryKeyName

func (o *Option) GetPrimaryKeyName() string

GetPrimaryKeyName returns the DB field name

func (*Option) GetPrimaryKeyValue

func (o *Option) GetPrimaryKeyValue() int64

GetPrimaryKeyValue returns the value, usually int64 of the PrimaryKey

func (*Option) Reload

func (o *Option) Reload() error

Reload A function to forcibly reload Option

func (*Option) Save

func (o *Option) Save() error

Save is a dynamic saver 'inherited' by all models

func (*Option) SetAutoload

func (o *Option) SetAutoload(arg string)

SetAutoload sets and marks as dirty the value of Option.Autoload

func (*Option) SetOptionId

func (o *Option) SetOptionId(arg int64)

SetOptionId sets and marks as dirty the value of Option.OptionId

func (*Option) SetOptionName

func (o *Option) SetOptionName(arg string)

SetOptionName sets and marks as dirty the value of Option.OptionName

func (*Option) SetOptionValue

func (o *Option) SetOptionValue(arg string)

SetOptionValue sets and marks as dirty the value of Option.OptionValue

func (*Option) Update

func (o *Option) Update() error

Update is a dynamic updater, it considers whether or not a field is 'dirty' and needs to be updated. Will only work if you use the Getters and Setters

func (*Option) UpdateAutoload

func (o *Option) UpdateAutoload(_updAutoload string) (int64, error)

UpdateAutoload an immediate DB Query to update a single column, in this case autoload

func (*Option) UpdateOptionName

func (o *Option) UpdateOptionName(_updOptionName string) (int64, error)

UpdateOptionName an immediate DB Query to update a single column, in this case option_name

func (*Option) UpdateOptionValue

func (o *Option) UpdateOptionValue(_updOptionValue string) (int64, error)

UpdateOptionValue an immediate DB Query to update a single column, in this case option_value

func (*Option) Where

func (o *Option) Where(s string) ([]*Option, error)

Where is a shortcut to FindBySql, in this case you only specify the WHERE clause, such as m.Where(`ID IN (23,25)`)

type Post

type Post struct {
	ID                  int64
	PostAuthor          int64
	PostDate            *DateTime
	PostDateGmt         *DateTime
	PostContent         string
	PostTitle           string
	PostExcerpt         string
	PostStatus          string
	CommentStatus       string
	PingStatus          string
	PostPassword        string
	PostName            string
	ToPing              string
	Pinged              string
	PostModified        *DateTime
	PostModifiedGmt     *DateTime
	PostContentFiltered string
	PostParent          int64
	Guid                string
	MenuOrder           int
	PostType            string
	PostMimeType        string
	CommentCount        int64
	// Dirty markers for smart updates
	IsIDDirty                  bool
	IsPostAuthorDirty          bool
	IsPostDateDirty            bool
	IsPostDateGmtDirty         bool
	IsPostContentDirty         bool
	IsPostTitleDirty           bool
	IsPostExcerptDirty         bool
	IsPostStatusDirty          bool
	IsCommentStatusDirty       bool
	IsPingStatusDirty          bool
	IsPostPasswordDirty        bool
	IsPostNameDirty            bool
	IsToPingDirty              bool
	IsPingedDirty              bool
	IsPostModifiedDirty        bool
	IsPostModifiedGmtDirty     bool
	IsPostContentFilteredDirty bool
	IsPostParentDirty          bool
	IsGuidDirty                bool
	IsMenuOrderDirty           bool
	IsPostTypeDirty            bool
	IsPostMimeTypeDirty        bool
	IsCommentCountDirty        bool
	// contains filtered or unexported fields
}

Post is a Object Relational Mapping to the database table that represents it. In this case it is posts. The table name will be Sprintf'd to include the prefix you define in your YAML configuration for the Adapter.

func NewPost

func NewPost(a Adapter) *Post

NewPost binds an Adapter to a new instance of Post and sets up the _table and primary keys

func (*Post) Create

func (o *Post) Create() error

Create inserts the model. Calling Save will call this function automatically for new models

func (*Post) Destroy

func (o *Post) Destroy() error

Destroy deletes the model

func (*Post) Find

func (o *Post) Find(_findByID int64) (bool, error)

Find searchs against the database table field ID and will return bool,error This method is a programatically generated finder for Post

Note that Find returns a bool of true|false if found or not, not err, in the case of found == true, the instance data will be filled out!

A call to find ALWAYS overwrites the model you call Find on i.e. receiver is a pointer!

```go

m := NewPost(a)
found,err := m.Find(23)
.. handle err
if found == false {
    // handle found
}
... do what you want with m here

```

func (*Post) FindByCommentCount

func (o *Post) FindByCommentCount(_findByCommentCount int64) ([]*Post, error)

FindByCommentCount searchs against the database table field comment_count and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByCommentCount(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByCommentStatus

func (o *Post) FindByCommentStatus(_findByCommentStatus string) ([]*Post, error)

FindByCommentStatus searchs against the database table field comment_status and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByCommentStatus(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByGuid

func (o *Post) FindByGuid(_findByGuid string) ([]*Post, error)

FindByGuid searchs against the database table field guid and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByGuid(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByMenuOrder

func (o *Post) FindByMenuOrder(_findByMenuOrder int) ([]*Post, error)

FindByMenuOrder searchs against the database table field menu_order and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByMenuOrder(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPingStatus

func (o *Post) FindByPingStatus(_findByPingStatus string) ([]*Post, error)

FindByPingStatus searchs against the database table field ping_status and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPingStatus(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPinged

func (o *Post) FindByPinged(_findByPinged string) ([]*Post, error)

FindByPinged searchs against the database table field pinged and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPinged(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPostAuthor

func (o *Post) FindByPostAuthor(_findByPostAuthor int64) ([]*Post, error)

FindByPostAuthor searchs against the database table field post_author and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPostAuthor(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPostContent

func (o *Post) FindByPostContent(_findByPostContent string) ([]*Post, error)

FindByPostContent searchs against the database table field post_content and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPostContent(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPostContentFiltered

func (o *Post) FindByPostContentFiltered(_findByPostContentFiltered string) ([]*Post, error)

FindByPostContentFiltered searchs against the database table field post_content_filtered and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPostContentFiltered(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPostDate

func (o *Post) FindByPostDate(_findByPostDate *DateTime) ([]*Post, error)

FindByPostDate searchs against the database table field post_date and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPostDate(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPostDateGmt

func (o *Post) FindByPostDateGmt(_findByPostDateGmt *DateTime) ([]*Post, error)

FindByPostDateGmt searchs against the database table field post_date_gmt and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPostDateGmt(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPostExcerpt

func (o *Post) FindByPostExcerpt(_findByPostExcerpt string) ([]*Post, error)

FindByPostExcerpt searchs against the database table field post_excerpt and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPostExcerpt(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPostMetaKeyValue

func (o *Post) FindByPostMetaKeyValue(k string, v string) ([]*Post, error)

func (*Post) FindByPostMimeType

func (o *Post) FindByPostMimeType(_findByPostMimeType string) ([]*Post, error)

FindByPostMimeType searchs against the database table field post_mime_type and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPostMimeType(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPostModified

func (o *Post) FindByPostModified(_findByPostModified *DateTime) ([]*Post, error)

FindByPostModified searchs against the database table field post_modified and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPostModified(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPostModifiedGmt

func (o *Post) FindByPostModifiedGmt(_findByPostModifiedGmt *DateTime) ([]*Post, error)

FindByPostModifiedGmt searchs against the database table field post_modified_gmt and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPostModifiedGmt(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPostName

func (o *Post) FindByPostName(_findByPostName string) ([]*Post, error)

FindByPostName searchs against the database table field post_name and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPostName(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPostParent

func (o *Post) FindByPostParent(_findByPostParent int64) ([]*Post, error)

FindByPostParent searchs against the database table field post_parent and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPostParent(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPostPassword

func (o *Post) FindByPostPassword(_findByPostPassword string) ([]*Post, error)

FindByPostPassword searchs against the database table field post_password and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPostPassword(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPostStatus

func (o *Post) FindByPostStatus(_findByPostStatus string) ([]*Post, error)

FindByPostStatus searchs against the database table field post_status and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPostStatus(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPostTitle

func (o *Post) FindByPostTitle(_findByPostTitle string) ([]*Post, error)

FindByPostTitle searchs against the database table field post_title and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPostTitle(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindByPostType

func (o *Post) FindByPostType(_findByPostType string) ([]*Post, error)

FindByPostType searchs against the database table field post_type and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByPostType(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FindBySQL

func (o *Post) FindBySQL(s string) ([]*Post, error)

FindBySQL allows you to search using a complete SQL string

func (*Post) FindByToPing

func (o *Post) FindByToPing(_findByToPing string) ([]*Post, error)

FindByToPing searchs against the database table field to_ping and will return []*Post,error This method is a programatically generated finder for Post

```go

m := NewPost(a)
results,err := m.FindByToPing(...)
// handle err
for i,r := results {
  // now r is an instance of Post
}

```

func (*Post) FromDBValueMap

func (o *Post) FromDBValueMap(m map[string]DBValue) error

FromDBValueMap Converts a DBValueMap returned from Adapter.Query to a Post

func (*Post) FromPost

func (o *Post) FromPost(m *Post)

FromPost A kind of Clone function for Post

func (*Post) GetCommentCount

func (o *Post) GetCommentCount() int64

GetCommentCount returns the value of Post.CommentCount

func (*Post) GetCommentStatus

func (o *Post) GetCommentStatus() string

GetCommentStatus returns the value of Post.CommentStatus

func (*Post) GetGuid

func (o *Post) GetGuid() string

GetGuid returns the value of Post.Guid

func (*Post) GetID

func (o *Post) GetID() int64

GetID returns the value of Post.ID

func (*Post) GetMenuOrder

func (o *Post) GetMenuOrder() int

GetMenuOrder returns the value of Post.MenuOrder

func (*Post) GetPingStatus

func (o *Post) GetPingStatus() string

GetPingStatus returns the value of Post.PingStatus

func (*Post) GetPinged

func (o *Post) GetPinged() string

GetPinged returns the value of Post.Pinged

func (*Post) GetPostAuthor

func (o *Post) GetPostAuthor() int64

GetPostAuthor returns the value of Post.PostAuthor

func (*Post) GetPostContent

func (o *Post) GetPostContent() string

GetPostContent returns the value of Post.PostContent

func (*Post) GetPostContentFiltered

func (o *Post) GetPostContentFiltered() string

GetPostContentFiltered returns the value of Post.PostContentFiltered

func (*Post) GetPostDate

func (o *Post) GetPostDate() *DateTime

GetPostDate returns the value of Post.PostDate

func (*Post) GetPostDateGmt

func (o *Post) GetPostDateGmt() *DateTime

GetPostDateGmt returns the value of Post.PostDateGmt

func (*Post) GetPostExcerpt

func (o *Post) GetPostExcerpt() string

GetPostExcerpt returns the value of Post.PostExcerpt

func (*Post) GetPostMimeType

func (o *Post) GetPostMimeType() string

GetPostMimeType returns the value of Post.PostMimeType

func (*Post) GetPostModified

func (o *Post) GetPostModified() *DateTime

GetPostModified returns the value of Post.PostModified

func (*Post) GetPostModifiedGmt

func (o *Post) GetPostModifiedGmt() *DateTime

GetPostModifiedGmt returns the value of Post.PostModifiedGmt

func (*Post) GetPostName

func (o *Post) GetPostName() string

GetPostName returns the value of Post.PostName

func (*Post) GetPostParent

func (o *Post) GetPostParent() int64

GetPostParent returns the value of Post.PostParent

func (*Post) GetPostPassword

func (o *Post) GetPostPassword() string

GetPostPassword returns the value of Post.PostPassword

func (*Post) GetPostStatus

func (o *Post) GetPostStatus() string

GetPostStatus returns the value of Post.PostStatus

func (*Post) GetPostTitle

func (o *Post) GetPostTitle() string

GetPostTitle returns the value of Post.PostTitle

func (*Post) GetPostType

func (o *Post) GetPostType() string

GetPostType returns the value of Post.PostType

func (*Post) GetPrimaryKeyName

func (o *Post) GetPrimaryKeyName() string

GetPrimaryKeyName returns the DB field name

func (*Post) GetPrimaryKeyValue

func (o *Post) GetPrimaryKeyValue() int64

GetPrimaryKeyValue returns the value, usually int64 of the PrimaryKey

func (*Post) GetToPing

func (o *Post) GetToPing() string

GetToPing returns the value of Post.ToPing

func (*Post) Reload

func (o *Post) Reload() error

Reload A function to forcibly reload Post

func (*Post) Save

func (o *Post) Save() error

Save is a dynamic saver 'inherited' by all models

func (*Post) SetCommentCount

func (o *Post) SetCommentCount(arg int64)

SetCommentCount sets and marks as dirty the value of Post.CommentCount

func (*Post) SetCommentStatus

func (o *Post) SetCommentStatus(arg string)

SetCommentStatus sets and marks as dirty the value of Post.CommentStatus

func (*Post) SetGuid

func (o *Post) SetGuid(arg string)

SetGuid sets and marks as dirty the value of Post.Guid

func (*Post) SetID

func (o *Post) SetID(arg int64)

SetID sets and marks as dirty the value of Post.ID

func (*Post) SetMenuOrder

func (o *Post) SetMenuOrder(arg int)

SetMenuOrder sets and marks as dirty the value of Post.MenuOrder

func (*Post) SetPingStatus

func (o *Post) SetPingStatus(arg string)

SetPingStatus sets and marks as dirty the value of Post.PingStatus

func (*Post) SetPinged

func (o *Post) SetPinged(arg string)

SetPinged sets and marks as dirty the value of Post.Pinged

func (*Post) SetPostAuthor

func (o *Post) SetPostAuthor(arg int64)

SetPostAuthor sets and marks as dirty the value of Post.PostAuthor

func (*Post) SetPostContent

func (o *Post) SetPostContent(arg string)

SetPostContent sets and marks as dirty the value of Post.PostContent

func (*Post) SetPostContentFiltered

func (o *Post) SetPostContentFiltered(arg string)

SetPostContentFiltered sets and marks as dirty the value of Post.PostContentFiltered

func (*Post) SetPostDate

func (o *Post) SetPostDate(arg *DateTime)

SetPostDate sets and marks as dirty the value of Post.PostDate

func (*Post) SetPostDateGmt

func (o *Post) SetPostDateGmt(arg *DateTime)

SetPostDateGmt sets and marks as dirty the value of Post.PostDateGmt

func (*Post) SetPostExcerpt

func (o *Post) SetPostExcerpt(arg string)

SetPostExcerpt sets and marks as dirty the value of Post.PostExcerpt

func (*Post) SetPostMimeType

func (o *Post) SetPostMimeType(arg string)

SetPostMimeType sets and marks as dirty the value of Post.PostMimeType

func (*Post) SetPostModified

func (o *Post) SetPostModified(arg *DateTime)

SetPostModified sets and marks as dirty the value of Post.PostModified

func (*Post) SetPostModifiedGmt

func (o *Post) SetPostModifiedGmt(arg *DateTime)

SetPostModifiedGmt sets and marks as dirty the value of Post.PostModifiedGmt

func (*Post) SetPostName

func (o *Post) SetPostName(arg string)

SetPostName sets and marks as dirty the value of Post.PostName

func (*Post) SetPostParent

func (o *Post) SetPostParent(arg int64)

SetPostParent sets and marks as dirty the value of Post.PostParent

func (*Post) SetPostPassword

func (o *Post) SetPostPassword(arg string)

SetPostPassword sets and marks as dirty the value of Post.PostPassword

func (*Post) SetPostStatus

func (o *Post) SetPostStatus(arg string)

SetPostStatus sets and marks as dirty the value of Post.PostStatus

func (*Post) SetPostTitle

func (o *Post) SetPostTitle(arg string)

SetPostTitle sets and marks as dirty the value of Post.PostTitle

func (*Post) SetPostType

func (o *Post) SetPostType(arg string)

SetPostType sets and marks as dirty the value of Post.PostType

func (*Post) SetToPing

func (o *Post) SetToPing(arg string)

SetToPing sets and marks as dirty the value of Post.ToPing

func (*Post) Update

func (o *Post) Update() error

Update is a dynamic updater, it considers whether or not a field is 'dirty' and needs to be updated. Will only work if you use the Getters and Setters

func (*Post) UpdateCommentCount

func (o *Post) UpdateCommentCount(_updCommentCount int64) (int64, error)

UpdateCommentCount an immediate DB Query to update a single column, in this case comment_count

func (*Post) UpdateCommentStatus

func (o *Post) UpdateCommentStatus(_updCommentStatus string) (int64, error)

UpdateCommentStatus an immediate DB Query to update a single column, in this case comment_status

func (*Post) UpdateGuid

func (o *Post) UpdateGuid(_updGuid string) (int64, error)

UpdateGuid an immediate DB Query to update a single column, in this case guid

func (*Post) UpdateMenuOrder

func (o *Post) UpdateMenuOrder(_updMenuOrder int) (int64, error)

UpdateMenuOrder an immediate DB Query to update a single column, in this case menu_order

func (*Post) UpdatePingStatus

func (o *Post) UpdatePingStatus(_updPingStatus string) (int64, error)

UpdatePingStatus an immediate DB Query to update a single column, in this case ping_status

func (*Post) UpdatePinged

func (o *Post) UpdatePinged(_updPinged string) (int64, error)

UpdatePinged an immediate DB Query to update a single column, in this case pinged

func (*Post) UpdatePostAuthor

func (o *Post) UpdatePostAuthor(_updPostAuthor int64) (int64, error)

UpdatePostAuthor an immediate DB Query to update a single column, in this case post_author

func (*Post) UpdatePostContent

func (o *Post) UpdatePostContent(_updPostContent string) (int64, error)

UpdatePostContent an immediate DB Query to update a single column, in this case post_content

func (*Post) UpdatePostContentFiltered

func (o *Post) UpdatePostContentFiltered(_updPostContentFiltered string) (int64, error)

UpdatePostContentFiltered an immediate DB Query to update a single column, in this case post_content_filtered

func (*Post) UpdatePostDate

func (o *Post) UpdatePostDate(_updPostDate *DateTime) (int64, error)

UpdatePostDate an immediate DB Query to update a single column, in this case post_date

func (*Post) UpdatePostDateGmt

func (o *Post) UpdatePostDateGmt(_updPostDateGmt *DateTime) (int64, error)

UpdatePostDateGmt an immediate DB Query to update a single column, in this case post_date_gmt

func (*Post) UpdatePostExcerpt

func (o *Post) UpdatePostExcerpt(_updPostExcerpt string) (int64, error)

UpdatePostExcerpt an immediate DB Query to update a single column, in this case post_excerpt

func (*Post) UpdatePostMimeType

func (o *Post) UpdatePostMimeType(_updPostMimeType string) (int64, error)

UpdatePostMimeType an immediate DB Query to update a single column, in this case post_mime_type

func (*Post) UpdatePostModified

func (o *Post) UpdatePostModified(_updPostModified *DateTime) (int64, error)

UpdatePostModified an immediate DB Query to update a single column, in this case post_modified

func (*Post) UpdatePostModifiedGmt

func (o *Post) UpdatePostModifiedGmt(_updPostModifiedGmt *DateTime) (int64, error)

UpdatePostModifiedGmt an immediate DB Query to update a single column, in this case post_modified_gmt

func (*Post) UpdatePostName

func (o *Post) UpdatePostName(_updPostName string) (int64, error)

UpdatePostName an immediate DB Query to update a single column, in this case post_name

func (*Post) UpdatePostParent

func (o *Post) UpdatePostParent(_updPostParent int64) (int64, error)

UpdatePostParent an immediate DB Query to update a single column, in this case post_parent

func (*Post) UpdatePostPassword

func (o *Post) UpdatePostPassword(_updPostPassword string) (int64, error)

UpdatePostPassword an immediate DB Query to update a single column, in this case post_password

func (*Post) UpdatePostStatus

func (o *Post) UpdatePostStatus(_updPostStatus string) (int64, error)

UpdatePostStatus an immediate DB Query to update a single column, in this case post_status

func (*Post) UpdatePostTitle

func (o *Post) UpdatePostTitle(_updPostTitle string) (int64, error)

UpdatePostTitle an immediate DB Query to update a single column, in this case post_title

func (*Post) UpdatePostType

func (o *Post) UpdatePostType(_updPostType string) (int64, error)

UpdatePostType an immediate DB Query to update a single column, in this case post_type

func (*Post) UpdateToPing

func (o *Post) UpdateToPing(_updToPing string) (int64, error)

UpdateToPing an immediate DB Query to update a single column, in this case to_ping

func (*Post) Where

func (o *Post) Where(s string) ([]*Post, error)

Where is a shortcut to FindBySql, in this case you only specify the WHERE clause, such as m.Where(`ID IN (23,25)`)

type PostMeta

type PostMeta struct {
	MetaId    int64
	PostId    int64
	MetaKey   string
	MetaValue string
	// Dirty markers for smart updates
	IsMetaIdDirty    bool
	IsPostIdDirty    bool
	IsMetaKeyDirty   bool
	IsMetaValueDirty bool
	// contains filtered or unexported fields
}

PostMeta is a Object Relational Mapping to the database table that represents it. In this case it is postmeta. The table name will be Sprintf'd to include the prefix you define in your YAML configuration for the Adapter.

func NewPostMeta

func NewPostMeta(a Adapter) *PostMeta

NewPostMeta binds an Adapter to a new instance of PostMeta and sets up the _table and primary keys

func (*PostMeta) Create

func (o *PostMeta) Create() error

Create inserts the model. Calling Save will call this function automatically for new models

func (*PostMeta) Destroy

func (o *PostMeta) Destroy() error

Destroy deletes the model

func (*PostMeta) Find

func (o *PostMeta) Find(_findByMetaId int64) (bool, error)

Find searchs against the database table field meta_id and will return bool,error This method is a programatically generated finder for PostMeta

Note that Find returns a bool of true|false if found or not, not err, in the case of found == true, the instance data will be filled out!

A call to find ALWAYS overwrites the model you call Find on i.e. receiver is a pointer!

```go

m := NewPostMeta(a)
found,err := m.Find(23)
.. handle err
if found == false {
    // handle found
}
... do what you want with m here

```

func (*PostMeta) FindByKeyValue

func (o *PostMeta) FindByKeyValue(k string, v string) ([]*PostMeta, error)

func (*PostMeta) FindByKeyValueWithPostId

func (o *PostMeta) FindByKeyValueWithPostId(k string, v string, pid int64) ([]*PostMeta, error)

func (*PostMeta) FindByMetaKey

func (o *PostMeta) FindByMetaKey(_findByMetaKey string) ([]*PostMeta, error)

FindByMetaKey searchs against the database table field meta_key and will return []*PostMeta,error This method is a programatically generated finder for PostMeta

```go

m := NewPostMeta(a)
results,err := m.FindByMetaKey(...)
// handle err
for i,r := results {
  // now r is an instance of PostMeta
}

```

func (*PostMeta) FindByMetaValue

func (o *PostMeta) FindByMetaValue(_findByMetaValue string) ([]*PostMeta, error)

FindByMetaValue searchs against the database table field meta_value and will return []*PostMeta,error This method is a programatically generated finder for PostMeta

```go

m := NewPostMeta(a)
results,err := m.FindByMetaValue(...)
// handle err
for i,r := results {
  // now r is an instance of PostMeta
}

```

func (*PostMeta) FindByPostId

func (o *PostMeta) FindByPostId(_findByPostId int64) ([]*PostMeta, error)

FindByPostId searchs against the database table field post_id and will return []*PostMeta,error This method is a programatically generated finder for PostMeta

```go

m := NewPostMeta(a)
results,err := m.FindByPostId(...)
// handle err
for i,r := results {
  // now r is an instance of PostMeta
}

```

func (*PostMeta) FindBySQL

func (o *PostMeta) FindBySQL(s string) ([]*PostMeta, error)

FindBySQL allows you to search using a complete SQL string

func (*PostMeta) FromDBValueMap

func (o *PostMeta) FromDBValueMap(m map[string]DBValue) error

FromDBValueMap Converts a DBValueMap returned from Adapter.Query to a PostMeta

func (*PostMeta) FromPostMeta

func (o *PostMeta) FromPostMeta(m *PostMeta)

FromPostMeta A kind of Clone function for PostMeta

func (*PostMeta) GetMetaId

func (o *PostMeta) GetMetaId() int64

GetMetaId returns the value of PostMeta.MetaId

func (*PostMeta) GetMetaKey

func (o *PostMeta) GetMetaKey() string

GetMetaKey returns the value of PostMeta.MetaKey

func (*PostMeta) GetMetaValue

func (o *PostMeta) GetMetaValue() string

GetMetaValue returns the value of PostMeta.MetaValue

func (*PostMeta) GetPostId

func (o *PostMeta) GetPostId() int64

GetPostId returns the value of PostMeta.PostId

func (*PostMeta) GetPrimaryKeyName

func (o *PostMeta) GetPrimaryKeyName() string

GetPrimaryKeyName returns the DB field name

func (*PostMeta) GetPrimaryKeyValue

func (o *PostMeta) GetPrimaryKeyValue() int64

GetPrimaryKeyValue returns the value, usually int64 of the PrimaryKey

func (*PostMeta) Reload

func (o *PostMeta) Reload() error

Reload A function to forcibly reload PostMeta

func (*PostMeta) Save

func (o *PostMeta) Save() error

Save is a dynamic saver 'inherited' by all models

func (*PostMeta) SetMetaId

func (o *PostMeta) SetMetaId(arg int64)

SetMetaId sets and marks as dirty the value of PostMeta.MetaId

func (*PostMeta) SetMetaKey

func (o *PostMeta) SetMetaKey(arg string)

SetMetaKey sets and marks as dirty the value of PostMeta.MetaKey

func (*PostMeta) SetMetaValue

func (o *PostMeta) SetMetaValue(arg string)

SetMetaValue sets and marks as dirty the value of PostMeta.MetaValue

func (*PostMeta) SetPostId

func (o *PostMeta) SetPostId(arg int64)

SetPostId sets and marks as dirty the value of PostMeta.PostId

func (*PostMeta) Update

func (o *PostMeta) Update() error

Update is a dynamic updater, it considers whether or not a field is 'dirty' and needs to be updated. Will only work if you use the Getters and Setters

func (*PostMeta) UpdateMetaKey

func (o *PostMeta) UpdateMetaKey(_updMetaKey string) (int64, error)

UpdateMetaKey an immediate DB Query to update a single column, in this case meta_key

func (*PostMeta) UpdateMetaValue

func (o *PostMeta) UpdateMetaValue(_updMetaValue string) (int64, error)

UpdateMetaValue an immediate DB Query to update a single column, in this case meta_value

func (*PostMeta) UpdatePostId

func (o *PostMeta) UpdatePostId(_updPostId int64) (int64, error)

UpdatePostId an immediate DB Query to update a single column, in this case post_id

func (*PostMeta) Where

func (o *PostMeta) Where(s string) ([]*PostMeta, error)

Where is a shortcut to FindBySql, in this case you only specify the WHERE clause, such as m.Where(`ID IN (23,25)`)

type SafeStringFilter

type SafeStringFilter func(string) string

SafeStringFilter is the function that escapes possible SQL Injection code.

type Term

type Term struct {
	TermId    int64
	Name      string
	Slug      string
	TermGroup int64
	// Dirty markers for smart updates
	IsTermIdDirty    bool
	IsNameDirty      bool
	IsSlugDirty      bool
	IsTermGroupDirty bool
	// contains filtered or unexported fields
}

Term is a Object Relational Mapping to the database table that represents it. In this case it is terms. The table name will be Sprintf'd to include the prefix you define in your YAML configuration for the Adapter.

func NewTerm

func NewTerm(a Adapter) *Term

NewTerm binds an Adapter to a new instance of Term and sets up the _table and primary keys

func (*Term) Create

func (o *Term) Create() error

Create inserts the model. Calling Save will call this function automatically for new models

func (*Term) Destroy

func (o *Term) Destroy() error

Destroy deletes the model

func (*Term) Find

func (o *Term) Find(_findByTermId int64) (bool, error)

Find searchs against the database table field term_id and will return bool,error This method is a programatically generated finder for Term

Note that Find returns a bool of true|false if found or not, not err, in the case of found == true, the instance data will be filled out!

A call to find ALWAYS overwrites the model you call Find on i.e. receiver is a pointer!

```go

m := NewTerm(a)
found,err := m.Find(23)
.. handle err
if found == false {
    // handle found
}
... do what you want with m here

```

func (*Term) FindByName

func (o *Term) FindByName(_findByName string) ([]*Term, error)

FindByName searchs against the database table field name and will return []*Term,error This method is a programatically generated finder for Term

```go

m := NewTerm(a)
results,err := m.FindByName(...)
// handle err
for i,r := results {
  // now r is an instance of Term
}

```

func (*Term) FindBySQL

func (o *Term) FindBySQL(s string) ([]*Term, error)

FindBySQL allows you to search using a complete SQL string

func (*Term) FindBySlug

func (o *Term) FindBySlug(_findBySlug string) ([]*Term, error)

FindBySlug searchs against the database table field slug and will return []*Term,error This method is a programatically generated finder for Term

```go

m := NewTerm(a)
results,err := m.FindBySlug(...)
// handle err
for i,r := results {
  // now r is an instance of Term
}

```

func (*Term) FindByTermGroup

func (o *Term) FindByTermGroup(_findByTermGroup int64) ([]*Term, error)

FindByTermGroup searchs against the database table field term_group and will return []*Term,error This method is a programatically generated finder for Term

```go

m := NewTerm(a)
results,err := m.FindByTermGroup(...)
// handle err
for i,r := results {
  // now r is an instance of Term
}

```

func (*Term) FromDBValueMap

func (o *Term) FromDBValueMap(m map[string]DBValue) error

FromDBValueMap Converts a DBValueMap returned from Adapter.Query to a Term

func (*Term) FromTerm

func (o *Term) FromTerm(m *Term)

FromTerm A kind of Clone function for Term

func (*Term) GetName

func (o *Term) GetName() string

GetName returns the value of Term.Name

func (*Term) GetPrimaryKeyName

func (o *Term) GetPrimaryKeyName() string

GetPrimaryKeyName returns the DB field name

func (*Term) GetPrimaryKeyValue

func (o *Term) GetPrimaryKeyValue() int64

GetPrimaryKeyValue returns the value, usually int64 of the PrimaryKey

func (*Term) GetSlug

func (o *Term) GetSlug() string

GetSlug returns the value of Term.Slug

func (*Term) GetTermGroup

func (o *Term) GetTermGroup() int64

GetTermGroup returns the value of Term.TermGroup

func (*Term) GetTermId

func (o *Term) GetTermId() int64

GetTermId returns the value of Term.TermId

func (*Term) Reload

func (o *Term) Reload() error

Reload A function to forcibly reload Term

func (*Term) Save

func (o *Term) Save() error

Save is a dynamic saver 'inherited' by all models

func (*Term) SetName

func (o *Term) SetName(arg string)

SetName sets and marks as dirty the value of Term.Name

func (*Term) SetSlug

func (o *Term) SetSlug(arg string)

SetSlug sets and marks as dirty the value of Term.Slug

func (*Term) SetTermGroup

func (o *Term) SetTermGroup(arg int64)

SetTermGroup sets and marks as dirty the value of Term.TermGroup

func (*Term) SetTermId

func (o *Term) SetTermId(arg int64)

SetTermId sets and marks as dirty the value of Term.TermId

func (*Term) Update

func (o *Term) Update() error

Update is a dynamic updater, it considers whether or not a field is 'dirty' and needs to be updated. Will only work if you use the Getters and Setters

func (*Term) UpdateName

func (o *Term) UpdateName(_updName string) (int64, error)

UpdateName an immediate DB Query to update a single column, in this case name

func (*Term) UpdateSlug

func (o *Term) UpdateSlug(_updSlug string) (int64, error)

UpdateSlug an immediate DB Query to update a single column, in this case slug

func (*Term) UpdateTermGroup

func (o *Term) UpdateTermGroup(_updTermGroup int64) (int64, error)

UpdateTermGroup an immediate DB Query to update a single column, in this case term_group

func (*Term) Where

func (o *Term) Where(s string) ([]*Term, error)

Where is a shortcut to FindBySql, in this case you only specify the WHERE clause, such as m.Where(`ID IN (23,25)`)

type TermRelationship

type TermRelationship struct {
	ObjectId       int64
	TermTaxonomyId int64
	TermOrder      int
	// Dirty markers for smart updates
	IsObjectIdDirty       bool
	IsTermTaxonomyIdDirty bool
	IsTermOrderDirty      bool
	// contains filtered or unexported fields
}

TermRelationship is a Object Relational Mapping to the database table that represents it. In this case it is term_relationships. The table name will be Sprintf'd to include the prefix you define in your YAML configuration for the Adapter.

func NewTermRelationship

func NewTermRelationship(a Adapter) *TermRelationship

NewTermRelationship binds an Adapter to a new instance of TermRelationship and sets up the _table and primary keys

func (*TermRelationship) Create

func (o *TermRelationship) Create() error

Create inserts the model. Calling Save will call this function automatically for new models

func (*TermRelationship) Destroy

func (o *TermRelationship) Destroy() error

Destroy deletes the model

func (*TermRelationship) Find

func (o *TermRelationship) Find(termId int64, objectId int64) (bool, error)

Find for the TermRelationship is a bit tricky, as it has no primary key as such, but a composite key.

func (*TermRelationship) FindByObjectId

func (o *TermRelationship) FindByObjectId(_findByObjectId int64) ([]*TermRelationship, error)

FindByObjectId searchs against the database table field object_id and will return []*TermRelationship,error This method is a programatically generated finder for TermRelationship

```go

m := NewTermRelationship(a)
results,err := m.FindByObjectId(...)
// handle err
for i,r := results {
  // now r is an instance of TermRelationship
}

```

func (*TermRelationship) FindBySQL

func (o *TermRelationship) FindBySQL(s string) ([]*TermRelationship, error)

FindBySQL allows you to search using a complete SQL string

func (*TermRelationship) FindByTermOrder

func (o *TermRelationship) FindByTermOrder(_findByTermOrder int) ([]*TermRelationship, error)

FindByTermOrder searchs against the database table field term_order and will return []*TermRelationship,error This method is a programatically generated finder for TermRelationship

```go

m := NewTermRelationship(a)
results,err := m.FindByTermOrder(...)
// handle err
for i,r := results {
  // now r is an instance of TermRelationship
}

```

func (*TermRelationship) FromDBValueMap

func (o *TermRelationship) FromDBValueMap(m map[string]DBValue) error

FromDBValueMap Converts a DBValueMap returned from Adapter.Query to a TermRelationship

func (*TermRelationship) FromTermRelationship

func (o *TermRelationship) FromTermRelationship(m *TermRelationship)

FromTermRelationship A kind of Clone function for TermRelationship

func (*TermRelationship) GetObjectId

func (o *TermRelationship) GetObjectId() int64

GetObjectId returns the value of TermRelationship.ObjectId

func (*TermRelationship) GetPrimaryKeyName

func (o *TermRelationship) GetPrimaryKeyName() string

GetPrimaryKeyName returns the DB field name

func (*TermRelationship) GetPrimaryKeyValue

func (o *TermRelationship) GetPrimaryKeyValue() int64

GetPrimaryKeyValue returns the value, usually int64 of the PrimaryKey

func (*TermRelationship) GetTermOrder

func (o *TermRelationship) GetTermOrder() int

GetTermOrder returns the value of TermRelationship.TermOrder

func (*TermRelationship) GetTermTaxonomyId

func (o *TermRelationship) GetTermTaxonomyId() int64

GetTermTaxonomyId returns the value of TermRelationship.TermTaxonomyId

func (*TermRelationship) Reload

func (o *TermRelationship) Reload() error

Reload A function to forcibly reload TermRelationship

func (*TermRelationship) Save

func (o *TermRelationship) Save() error

Save is a dynamic saver 'inherited' by all models

func (*TermRelationship) SetObjectId

func (o *TermRelationship) SetObjectId(arg int64)

SetObjectId sets and marks as dirty the value of TermRelationship.ObjectId

func (*TermRelationship) SetTermOrder

func (o *TermRelationship) SetTermOrder(arg int)

SetTermOrder sets and marks as dirty the value of TermRelationship.TermOrder

func (*TermRelationship) SetTermTaxonomyId

func (o *TermRelationship) SetTermTaxonomyId(arg int64)

SetTermTaxonomyId sets and marks as dirty the value of TermRelationship.TermTaxonomyId

func (*TermRelationship) Update

func (o *TermRelationship) Update() error

Update is a dynamic updater, it considers whether or not a field is 'dirty' and needs to be updated. Will only work if you use the Getters and Setters

func (*TermRelationship) UpdateObjectId

func (o *TermRelationship) UpdateObjectId(_updObjectId int64) (int64, error)

UpdateObjectId an immediate DB Query to update a single column, in this case object_id

func (*TermRelationship) UpdateTermOrder

func (o *TermRelationship) UpdateTermOrder(_updTermOrder int) (int64, error)

UpdateTermOrder an immediate DB Query to update a single column, in this case term_order

func (*TermRelationship) Where

func (o *TermRelationship) Where(s string) ([]*TermRelationship, error)

Where is a shortcut to FindBySql, in this case you only specify the WHERE clause, such as m.Where(`ID IN (23,25)`)

type TermTaxonomy

type TermTaxonomy struct {
	TermTaxonomyId int64
	TermId         int64
	Taxonomy       string
	Description    string
	Parent         int64
	Count          int64
	// Dirty markers for smart updates
	IsTermTaxonomyIdDirty bool
	IsTermIdDirty         bool
	IsTaxonomyDirty       bool
	IsDescriptionDirty    bool
	IsParentDirty         bool
	IsCountDirty          bool
	// contains filtered or unexported fields
}

TermTaxonomy is a Object Relational Mapping to the database table that represents it. In this case it is term_taxonomy. The table name will be Sprintf'd to include the prefix you define in your YAML configuration for the Adapter.

func NewTermTaxonomy

func NewTermTaxonomy(a Adapter) *TermTaxonomy

NewTermTaxonomy binds an Adapter to a new instance of TermTaxonomy and sets up the _table and primary keys

func (*TermTaxonomy) Create

func (o *TermTaxonomy) Create() error

Create inserts the model. Calling Save will call this function automatically for new models

func (*TermTaxonomy) Destroy

func (o *TermTaxonomy) Destroy() error

Destroy deletes the model

func (*TermTaxonomy) Find

func (o *TermTaxonomy) Find(_findByTermTaxonomyId int64) (bool, error)

Find searchs against the database table field term_taxonomy_id and will return bool,error This method is a programatically generated finder for TermTaxonomy

Note that Find returns a bool of true|false if found or not, not err, in the case of found == true, the instance data will be filled out!

A call to find ALWAYS overwrites the model you call Find on i.e. receiver is a pointer!

```go

m := NewTermTaxonomy(a)
found,err := m.Find(23)
.. handle err
if found == false {
    // handle found
}
... do what you want with m here

```

func (*TermTaxonomy) FindByCount

func (o *TermTaxonomy) FindByCount(_findByCount int64) ([]*TermTaxonomy, error)

FindByCount searchs against the database table field count and will return []*TermTaxonomy,error This method is a programatically generated finder for TermTaxonomy

```go

m := NewTermTaxonomy(a)
results,err := m.FindByCount(...)
// handle err
for i,r := results {
  // now r is an instance of TermTaxonomy
}

```

func (*TermTaxonomy) FindByDescription

func (o *TermTaxonomy) FindByDescription(_findByDescription string) ([]*TermTaxonomy, error)

FindByDescription searchs against the database table field description and will return []*TermTaxonomy,error This method is a programatically generated finder for TermTaxonomy

```go

m := NewTermTaxonomy(a)
results,err := m.FindByDescription(...)
// handle err
for i,r := results {
  // now r is an instance of TermTaxonomy
}

```

func (*TermTaxonomy) FindByParent

func (o *TermTaxonomy) FindByParent(_findByParent int64) ([]*TermTaxonomy, error)

FindByParent searchs against the database table field parent and will return []*TermTaxonomy,error This method is a programatically generated finder for TermTaxonomy

```go

m := NewTermTaxonomy(a)
results,err := m.FindByParent(...)
// handle err
for i,r := results {
  // now r is an instance of TermTaxonomy
}

```

func (*TermTaxonomy) FindBySQL

func (o *TermTaxonomy) FindBySQL(s string) ([]*TermTaxonomy, error)

FindBySQL allows you to search using a complete SQL string

func (*TermTaxonomy) FindByTaxonomy

func (o *TermTaxonomy) FindByTaxonomy(_findByTaxonomy string) ([]*TermTaxonomy, error)

FindByTaxonomy searchs against the database table field taxonomy and will return []*TermTaxonomy,error This method is a programatically generated finder for TermTaxonomy

```go

m := NewTermTaxonomy(a)
results,err := m.FindByTaxonomy(...)
// handle err
for i,r := results {
  // now r is an instance of TermTaxonomy
}

```

func (*TermTaxonomy) FindByTermId

func (o *TermTaxonomy) FindByTermId(_findByTermId int64) ([]*TermTaxonomy, error)

FindByTermId searchs against the database table field term_id and will return []*TermTaxonomy,error This method is a programatically generated finder for TermTaxonomy

```go

m := NewTermTaxonomy(a)
results,err := m.FindByTermId(...)
// handle err
for i,r := results {
  // now r is an instance of TermTaxonomy
}

```

func (*TermTaxonomy) FromDBValueMap

func (o *TermTaxonomy) FromDBValueMap(m map[string]DBValue) error

FromDBValueMap Converts a DBValueMap returned from Adapter.Query to a TermTaxonomy

func (*TermTaxonomy) FromTermTaxonomy

func (o *TermTaxonomy) FromTermTaxonomy(m *TermTaxonomy)

FromTermTaxonomy A kind of Clone function for TermTaxonomy

func (*TermTaxonomy) GetCount

func (o *TermTaxonomy) GetCount() int64

GetCount returns the value of TermTaxonomy.Count

func (*TermTaxonomy) GetDescription

func (o *TermTaxonomy) GetDescription() string

GetDescription returns the value of TermTaxonomy.Description

func (*TermTaxonomy) GetParent

func (o *TermTaxonomy) GetParent() int64

GetParent returns the value of TermTaxonomy.Parent

func (*TermTaxonomy) GetPrimaryKeyName

func (o *TermTaxonomy) GetPrimaryKeyName() string

GetPrimaryKeyName returns the DB field name

func (*TermTaxonomy) GetPrimaryKeyValue

func (o *TermTaxonomy) GetPrimaryKeyValue() int64

GetPrimaryKeyValue returns the value, usually int64 of the PrimaryKey

func (*TermTaxonomy) GetTaxonomy

func (o *TermTaxonomy) GetTaxonomy() string

GetTaxonomy returns the value of TermTaxonomy.Taxonomy

func (*TermTaxonomy) GetTermId

func (o *TermTaxonomy) GetTermId() int64

GetTermId returns the value of TermTaxonomy.TermId

func (*TermTaxonomy) GetTermTaxonomyId

func (o *TermTaxonomy) GetTermTaxonomyId() int64

GetTermTaxonomyId returns the value of TermTaxonomy.TermTaxonomyId

func (*TermTaxonomy) Reload

func (o *TermTaxonomy) Reload() error

Reload A function to forcibly reload TermTaxonomy

func (*TermTaxonomy) Save

func (o *TermTaxonomy) Save() error

Save is a dynamic saver 'inherited' by all models

func (*TermTaxonomy) SetCount

func (o *TermTaxonomy) SetCount(arg int64)

SetCount sets and marks as dirty the value of TermTaxonomy.Count

func (*TermTaxonomy) SetDescription

func (o *TermTaxonomy) SetDescription(arg string)

SetDescription sets and marks as dirty the value of TermTaxonomy.Description

func (*TermTaxonomy) SetParent

func (o *TermTaxonomy) SetParent(arg int64)

SetParent sets and marks as dirty the value of TermTaxonomy.Parent

func (*TermTaxonomy) SetTaxonomy

func (o *TermTaxonomy) SetTaxonomy(arg string)

SetTaxonomy sets and marks as dirty the value of TermTaxonomy.Taxonomy

func (*TermTaxonomy) SetTermId

func (o *TermTaxonomy) SetTermId(arg int64)

SetTermId sets and marks as dirty the value of TermTaxonomy.TermId

func (*TermTaxonomy) SetTermTaxonomyId

func (o *TermTaxonomy) SetTermTaxonomyId(arg int64)

SetTermTaxonomyId sets and marks as dirty the value of TermTaxonomy.TermTaxonomyId

func (*TermTaxonomy) Update

func (o *TermTaxonomy) Update() error

Update is a dynamic updater, it considers whether or not a field is 'dirty' and needs to be updated. Will only work if you use the Getters and Setters

func (*TermTaxonomy) UpdateCount

func (o *TermTaxonomy) UpdateCount(_updCount int64) (int64, error)

UpdateCount an immediate DB Query to update a single column, in this case count

func (*TermTaxonomy) UpdateDescription

func (o *TermTaxonomy) UpdateDescription(_updDescription string) (int64, error)

UpdateDescription an immediate DB Query to update a single column, in this case description

func (*TermTaxonomy) UpdateParent

func (o *TermTaxonomy) UpdateParent(_updParent int64) (int64, error)

UpdateParent an immediate DB Query to update a single column, in this case parent

func (*TermTaxonomy) UpdateTaxonomy

func (o *TermTaxonomy) UpdateTaxonomy(_updTaxonomy string) (int64, error)

UpdateTaxonomy an immediate DB Query to update a single column, in this case taxonomy

func (*TermTaxonomy) UpdateTermId

func (o *TermTaxonomy) UpdateTermId(_updTermId int64) (int64, error)

UpdateTermId an immediate DB Query to update a single column, in this case term_id

func (*TermTaxonomy) Where

func (o *TermTaxonomy) Where(s string) ([]*TermTaxonomy, error)

Where is a shortcut to FindBySql, in this case you only specify the WHERE clause, such as m.Where(`ID IN (23,25)`)

type UserMeta

type UserMeta struct {
	UMetaId   int64
	UserId    int64
	MetaKey   string
	MetaValue string
	// Dirty markers for smart updates
	IsUMetaIdDirty   bool
	IsUserIdDirty    bool
	IsMetaKeyDirty   bool
	IsMetaValueDirty bool
	// contains filtered or unexported fields
}

UserMeta is a Object Relational Mapping to the database table that represents it. In this case it is usermeta. The table name will be Sprintf'd to include the prefix you define in your YAML configuration for the Adapter.

func NewUserMeta

func NewUserMeta(a Adapter) *UserMeta

NewUserMeta binds an Adapter to a new instance of UserMeta and sets up the _table and primary keys

func (*UserMeta) Create

func (o *UserMeta) Create() error

Create inserts the model. Calling Save will call this function automatically for new models

func (*UserMeta) Destroy

func (o *UserMeta) Destroy() error

Destroy deletes the model

func (*UserMeta) Find

func (o *UserMeta) Find(_findByUMetaId int64) (bool, error)

Find searchs against the database table field umeta_id and will return bool,error This method is a programatically generated finder for UserMeta

Note that Find returns a bool of true|false if found or not, not err, in the case of found == true, the instance data will be filled out!

A call to find ALWAYS overwrites the model you call Find on i.e. receiver is a pointer!

```go

m := NewUserMeta(a)
found,err := m.Find(23)
.. handle err
if found == false {
    // handle found
}
... do what you want with m here

```

func (*UserMeta) FindByMetaKey

func (o *UserMeta) FindByMetaKey(_findByMetaKey string) ([]*UserMeta, error)

FindByMetaKey searchs against the database table field meta_key and will return []*UserMeta,error This method is a programatically generated finder for UserMeta

```go

m := NewUserMeta(a)
results,err := m.FindByMetaKey(...)
// handle err
for i,r := results {
  // now r is an instance of UserMeta
}

```

func (*UserMeta) FindByMetaValue

func (o *UserMeta) FindByMetaValue(_findByMetaValue string) ([]*UserMeta, error)

FindByMetaValue searchs against the database table field meta_value and will return []*UserMeta,error This method is a programatically generated finder for UserMeta

```go

m := NewUserMeta(a)
results,err := m.FindByMetaValue(...)
// handle err
for i,r := results {
  // now r is an instance of UserMeta
}

```

func (*UserMeta) FindBySQL

func (o *UserMeta) FindBySQL(s string) ([]*UserMeta, error)

FindBySQL allows you to search using a complete SQL string

func (*UserMeta) FindByUserId

func (o *UserMeta) FindByUserId(_findByUserId int64) ([]*UserMeta, error)

FindByUserId searchs against the database table field user_id and will return []*UserMeta,error This method is a programatically generated finder for UserMeta

```go

m := NewUserMeta(a)
results,err := m.FindByUserId(...)
// handle err
for i,r := results {
  // now r is an instance of UserMeta
}

```

func (*UserMeta) FromDBValueMap

func (o *UserMeta) FromDBValueMap(m map[string]DBValue) error

FromDBValueMap Converts a DBValueMap returned from Adapter.Query to a UserMeta

func (*UserMeta) FromUserMeta

func (o *UserMeta) FromUserMeta(m *UserMeta)

FromUserMeta A kind of Clone function for UserMeta

func (*UserMeta) GetMetaKey

func (o *UserMeta) GetMetaKey() string

GetMetaKey returns the value of UserMeta.MetaKey

func (*UserMeta) GetMetaValue

func (o *UserMeta) GetMetaValue() string

GetMetaValue returns the value of UserMeta.MetaValue

func (*UserMeta) GetPrimaryKeyName

func (o *UserMeta) GetPrimaryKeyName() string

GetPrimaryKeyName returns the DB field name

func (*UserMeta) GetPrimaryKeyValue

func (o *UserMeta) GetPrimaryKeyValue() int64

GetPrimaryKeyValue returns the value, usually int64 of the PrimaryKey

func (*UserMeta) GetUMetaId

func (o *UserMeta) GetUMetaId() int64

GetUMetaId returns the value of UserMeta.UMetaId

func (*UserMeta) GetUserId

func (o *UserMeta) GetUserId() int64

GetUserId returns the value of UserMeta.UserId

func (*UserMeta) Reload

func (o *UserMeta) Reload() error

Reload A function to forcibly reload UserMeta

func (*UserMeta) Save

func (o *UserMeta) Save() error

Save is a dynamic saver 'inherited' by all models

func (*UserMeta) SetMetaKey

func (o *UserMeta) SetMetaKey(arg string)

SetMetaKey sets and marks as dirty the value of UserMeta.MetaKey

func (*UserMeta) SetMetaValue

func (o *UserMeta) SetMetaValue(arg string)

SetMetaValue sets and marks as dirty the value of UserMeta.MetaValue

func (*UserMeta) SetUMetaId

func (o *UserMeta) SetUMetaId(arg int64)

SetUMetaId sets and marks as dirty the value of UserMeta.UMetaId

func (*UserMeta) SetUserId

func (o *UserMeta) SetUserId(arg int64)

SetUserId sets and marks as dirty the value of UserMeta.UserId

func (*UserMeta) Update

func (o *UserMeta) Update() error

Update is a dynamic updater, it considers whether or not a field is 'dirty' and needs to be updated. Will only work if you use the Getters and Setters

func (*UserMeta) UpdateMetaKey

func (o *UserMeta) UpdateMetaKey(_updMetaKey string) (int64, error)

UpdateMetaKey an immediate DB Query to update a single column, in this case meta_key

func (*UserMeta) UpdateMetaValue

func (o *UserMeta) UpdateMetaValue(_updMetaValue string) (int64, error)

UpdateMetaValue an immediate DB Query to update a single column, in this case meta_value

func (*UserMeta) UpdateUserId

func (o *UserMeta) UpdateUserId(_updUserId int64) (int64, error)

UpdateUserId an immediate DB Query to update a single column, in this case user_id

func (*UserMeta) Where

func (o *UserMeta) Where(s string) ([]*UserMeta, error)

Where is a shortcut to FindBySql, in this case you only specify the WHERE clause, such as m.Where(`ID IN (23,25)`)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL