Class yeesoft\comments\models\Comment

Inheritanceyeesoft\comments\models\Comment » yii\db\ActiveRecord
Subclassesyeesoft\comment\models\search\CommentSearch

Description of Comment

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
SCENARIO_GUEST 'guest' yeesoft\comments\models\Comment
SCENARIO_USER 'user' yeesoft\comments\models\Comment
STATUS_APPROVED 1 yeesoft\comments\models\Comment
STATUS_PENDING 0 yeesoft\comments\models\Comment
STATUS_PUBLISHED self::STATUS_APPROVED yeesoft\comments\models\Comment
STATUS_SPAM 2 yeesoft\comments\models\Comment
STATUS_TRASH 3 yeesoft\comments\models\Comment

Method Details

activeCount() public static method

Get count of active comments by $model and $model_id

public static int activeCount ( $model, $model_id NULL )
$model string
$model_id int
attributeLabels() public method

public void attributeLabels ( )
behaviors() public method

public void behaviors ( )
find() public static method

public static yeesoft\comments\models\CommentQuery find ( $loadComments false )
$loadComments
return yeesoft\comments\models\CommentQuery

The active query used by this AR class.

getAuthor() public method

Get author of comment

public string getAuthor ( )
getComments() public method

public void getComments ( )
getCreatedDate() public method

Get created date

public string getCreatedDate ( $format 'Y-m-d' )
$format string

Date format

getCreatedTime() public method

Get created time

public string getCreatedTime ( $format 'H:i' )
$format string

Time format

getStatusList() public static method

GetTypeList

public static array getStatusList ( )
getStatusOptionsList() public static method

GetStatusOptionsList

public static array getStatusOptionsList ( )
getUpdatedDate() public method

Get created date

public string getUpdatedDate ( $format 'Y-m-d' )
$format string

Date format

getUpdatedTime() public method

Get created time

public string getUpdatedTime ( $format 'H:i' )
$format string

Time format

init() public method

public void init ( )
isReplied() public method

Check whether comment has replies

public int isReplied ( )
return int

Nubmer of replies

rules() public method

public void rules ( )
save() public method

public void save ( $runValidation true, $attributeNames null )
$runValidation
$attributeNames
scenarios() public method

public void scenarios ( )
setComments() public method

public void setComments ( $comments )
$comments
setUserData() public method

Updates user's data before comment insert

public void setUserData ( )
tableName() public static method

public static void tableName ( )