Пример #1
0
 public function getPosts()
 {
     return $this->hasMany(Post::className(), ['id' => 'post_id'])->viaTable('{{%podium_vocabulary_junction}}', ['word_id' => 'id']);
 }
Пример #2
0
 public function getLatest()
 {
     return $this->hasOne(Post::className(), ['forum_id' => 'id'])->orderBy(['id' => SORT_DESC]);
 }
Пример #3
0
 /**
  * First edited not seen post relation.
  * @return Post
  */
 public function getFirstEditedNotSeen()
 {
     return $this->hasOne(Post::className(), ['thread_id' => 'id'])->where(['>', 'edited_at', $this->userView ? $this->userView->edited_last_seen : 0])->orderBy(['id' => SORT_ASC]);
 }