コード例 #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
ファイル: Discussion.php プロジェクト: CNeverDie/CommentSG
 /**
  * @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']);
 }