示例#1
0
文件: Comment.php 项目: awebc/web_xbf
 public function getParent()
 {
     if ($this->parent_id) {
         return $this->hasOne(Comment::className(), ['id' => 'parent_id']);
     }
     return null;
 }
示例#2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getComments()
 {
     return $this->hasMany(Comment::className(), ['discussionID' => 'id']);
 }
示例#3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getComments()
 {
     return $this->hasMany(Comment::className(), ['model_class' => 'id']);
 }