PHP Class Phosphorum\Models\Posts

Inheritance: extends Phalcon\Mvc\Model
Datei anzeigen Open project: phalcon/forum Class Usage Examples

Public Properties

Property Type Description
$accepted_answer
$categories_id
$content
$created_at
$deleted
$edited_at
$id
$locked
$modified_at
$number_replies
$number_views
$slug
$status
$sticked
$title
$users_id
$votes_down
$votes_up

Public Methods

Method Description
afterCreate ( )
afterDelete ( )
afterSave ( )
beforeCreate ( ) Create a posts-views logging the ipaddress where the post was created This avoids that the same session counts as post view
beforeValidationOnCreate ( )
canHaveBounty ( ) : boolean Checks if the post can have a bounty
clearCache ( ) Clears the cache related to this post
getBounty ( ) : array | boolean Calculates a bounty for the post
getDifference ( )
getHumanCreatedAt ( ) : boolean | string
getHumanEditedAt ( ) : boolean | string
getHumanModifiedAt ( ) : boolean | string
getHumanNumberViews ( ) : string
getRecentUsers ( ) : array
getUTCModifiedAt ( ) : string Returns a W3C date to be used in the sitemap.
hasAcceptedAnswer ( ) : boolean Checks if the Post has accepted answer
hasPoll ( ) : boolean Checks if the Post has a Poll
hasReplies ( ) : boolean Checks if the Post has replies
initialize ( )
isParticipatedInPoll ( integer $userId ) : boolean Checks if User is participated in a Poll
isStartVoting ( ) : boolean Checks if the voting for the poll was started
isSubscribed ( integer $userId ) : boolean Checks whether a specific user is subscribed to the post

Method Details

afterCreate() public method

public afterCreate ( )

afterDelete() public method

public afterDelete ( )

afterSave() public method

public afterSave ( )

beforeCreate() public method

Create a posts-views logging the ipaddress where the post was created This avoids that the same session counts as post view
public beforeCreate ( )

beforeValidationOnCreate() public method

canHaveBounty() public method

Checks if the post can have a bounty
public canHaveBounty ( ) : boolean
return boolean

clearCache() public method

Clears the cache related to this post
public clearCache ( )

getBounty() public method

Calculates a bounty for the post
public getBounty ( ) : array | boolean
return array | boolean

getDifference() public method

public getDifference ( )

getHumanCreatedAt() public method

public getHumanCreatedAt ( ) : boolean | string
return boolean | string

getHumanEditedAt() public method

public getHumanEditedAt ( ) : boolean | string
return boolean | string

getHumanModifiedAt() public method

public getHumanModifiedAt ( ) : boolean | string
return boolean | string

getHumanNumberViews() public method

public getHumanNumberViews ( ) : string
return string

getRecentUsers() public method

public getRecentUsers ( ) : array
return array

getUTCModifiedAt() public method

Returns a W3C date to be used in the sitemap.
public getUTCModifiedAt ( ) : string
return string

hasAcceptedAnswer() public method

Checks if the Post has accepted answer
public hasAcceptedAnswer ( ) : boolean
return boolean

hasPoll() public method

Checks if the Post has a Poll
public hasPoll ( ) : boolean
return boolean

hasReplies() public method

Checks if the Post has replies
public hasReplies ( ) : boolean
return boolean

initialize() public method

public initialize ( )

isParticipatedInPoll() public method

Checks if User is participated in a Poll
public isParticipatedInPoll ( integer $userId ) : boolean
$userId integer User ID
return boolean

isStartVoting() public method

Checks if the voting for the poll was started
public isStartVoting ( ) : boolean
return boolean

isSubscribed() public method

Checks whether a specific user is subscribed to the post
public isSubscribed ( integer $userId ) : boolean
$userId integer
return boolean

Property Details

$accepted_answer public_oe property

public $accepted_answer

$categories_id public_oe property

public $categories_id

$content public_oe property

public $content

$created_at public_oe property

public $created_at

$deleted public_oe property

public $deleted

$edited_at public_oe property

public $edited_at

$id public_oe property

public $id

$locked public_oe property

public $locked

$modified_at public_oe property

public $modified_at

$number_replies public_oe property

public $number_replies

$number_views public_oe property

public $number_views

$slug public_oe property

public $slug

$status public_oe property

public $status

$sticked public_oe property

public $sticked

$title public_oe property

public $title

$users_id public_oe property

public $users_id

$votes_down public_oe property

public $votes_down

$votes_up public_oe property

public $votes_up