Post

Extends\CActiveRecord

The followings are the available columns in table 'tbl_post':

package

Default

Methods

Adds a new comment to this post.

addComment( $comment): boolean

This method will set status and post_id of the comment accordingly.

Arguments

$comment

Response

boolean

whether the comment is saved successfully

This is invoked after the record is deleted.

afterDelete()

This is invoked when a record is populated with data from a find() call.

afterFind()

This is invoked after the record is saved.

afterSave()

attributeLabels

attributeLabels(): array

Response

array

customized attribute labels (name=>label)

This is invoked before the record is saved.

beforeSave(): boolean

Response

boolean

whether the record should be saved.

getUrl

getUrl(): string

Response

string

the URL that shows the detail of the post

Returns the static model of the specified AR class.

model( $className = __CLASS__): static
static

Arguments

$className

Response

static

the static model class

Normalizes the user-entered tags.

normalizeTags( $attribute, $params)

Arguments

$attribute

$params

relations

relations(): array

Response

array

relational rules.

rules

rules(): array

Response

array

validation rules for model attributes.

tableName

tableName(): string

Response

string

the associated database table name

Constants

STATUS_DRAFT

STATUS_DRAFT

STATUS_PUBLISHED

STATUS_PUBLISHED

STATUS_ARCHIVED

STATUS_ARCHIVED

Properties

_oldTags

_oldTags :

Type(s)

id

id :integer

Type(s)

integer

title

title :string

Type(s)

string

content

content :string

Type(s)

string

tags

tags :string

Type(s)

string

status

status :integer

Type(s)

integer

create_time

create_time :integer

Type(s)

integer

update_time

update_time :integer

Type(s)

integer

author_id

author_id :integer

Type(s)

integer