예제 #1
0
파일: Post.php 프로젝트: grutabow/Yii2Blog
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getComments()
 {
     return $this->hasMany(Comment::className(), ['post_id' => 'id'])->where('status = ' . Comment::STATUS_APPROVED)->orderBy('id');
 }
예제 #2
0
파일: Topic.php 프로젝트: 0ps/simpleforum
 public function getComments()
 {
     return $this->hasMany(Comment::className(), ['topic_id' => 'id']);
 }
예제 #3
0
파일: User.php 프로젝트: nicdnepr/skidos
 public function getAuthorComments()
 {
     return $this->hasMany(Comment::className(), ['author_id' => 'id']);
 }
예제 #4
0
파일: User.php 프로젝트: 0ps/simpleforum
 public function getComments()
 {
     return $this->hasMany(Comment::className(), ['user_id' => 'id'])->select(['id', 'user_id', 'topic_id', 'created_at', 'invisible', 'content'])->limit(10)->orderBy(['id' => SORT_DESC]);
 }
예제 #5
0
파일: Test.php 프로젝트: huangjiaozhu/OSup-
 public function getComments()
 {
     return $this->hasMany(Comment::className(), ['test_id' => 'id'])->orderBy('commentdate');
 }
예제 #6
0
 public function getComments()
 {
     return $this->hasMany(Comment::className(), ['book_id' => 'id'])->orderBy('created_at DESC');
 }
예제 #7
0
파일: Comment.php 프로젝트: Sywooch/notes
 public function getComments()
 {
     return $this->hasMany(Comment::className(), ['id' => 'child_id'])->via('commentClosures');
 }
예제 #8
0
 public function getComment()
 {
     return $this->hasOne(Comment::className(), ['id' => 'parent_id']);
 }
예제 #9
0
 public function getComments()
 {
     return $this->hasMany(Comment::className(), ['author' => 'email']);
 }
예제 #10
0
 public function getAllComments()
 {
     return $this->hasMany(Comment::className(), ['uid' => 'id'])->orderBy(['is_top' => SORT_DESC, 'post_time' => SORT_DESC]);
 }
예제 #11
0
파일: Topic.php 프로젝트: abzal1991/itblog
 public function getCommentCount()
 {
     return $this->hasMany(Comment::className(), ['target_id' => 'topic_id'])->where(['target_type' => 'topic'])->count();
 }
예제 #12
0
 public function getAllComments()
 {
     return $this->hasMany(Comment::className(), ['pid' => 'id'])->onCondition(['status' => Comment::STATUS_APPROVED])->orderBy(['create_time' => SORT_ASC]);
 }
예제 #13
0
파일: Product.php 프로젝트: vetoni/toko
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getComments()
 {
     return $this->hasMany(Comment::className(), ['product_id' => 'id'])->orderBy(['created_at' => SORT_DESC]);
 }