本文整理汇总了PHP中common\models\Comment::className方法的典型用法代码示例。如果您正苦于以下问题:PHP Comment::className方法的具体用法?PHP Comment::className怎么用?PHP Comment::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common\models\Comment
的用法示例。
在下文中一共展示了Comment::className方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getComments
/**
* @return \yii\db\ActiveQuery
*/
public function getComments()
{
return $this->hasMany(Comment::className(), ['section_id' => 'id']);
}
示例2: getParent
public function getParent()
{
return $this->hasOne(Comment::className(), ['id' => 'parent_id']);
}
示例3: getComments
/**
* 关联关系,获取评论信息,按时间倒序排列
* @return ActiveQuery
*/
public function getComments()
{
return $this->hasMany(Comment::className(), ['post_id' => 'id'])->orderBy(Comment::tableName() . '.created_at DESC');
}
示例4: getSons
/**
* 获取所有子评论
* @return \yii\db\ActiveQuery
*/
public function getSons()
{
return $this->hasMany(Comment::className(), ['parent_id' => 'id']);
}
示例5: getComment
public function getComment()
{
return $this->hasOne(Comment::className(), ['id' => 'commentID']);
}
示例6: getComments
/**
* @return \yii\db\ActiveQuery
*/
public function getComments()
{
return $this->hasMany(Comment::className(), ['post_id' => 'id'])->where('status = ' . Comment::STATUS_ACTIVE)->orderBy('id');
}
示例7: getCommentsPassedBad
/**
* @return \yii\db\ActiveQuery
*/
public function getCommentsPassedBad()
{
return $this->hasMany(Comment::className(), ['product_id' => 'id'])->where(['status' => Status::STATUS_ACTIVE, 'star' => 1])->orderBy(['created_at' => SORT_DESC]);
}
示例8: getChildComments
/**
* @return \yii\db\ActiveQuery
*/
public function getChildComments()
{
return $this->hasMany(Comment::className(), ['parent' => 'id']);
}