Esempio n. 1
0
 public function getThread()
 {
     return $this->hasOne(Threads::className(), ['id' => 'thread_id'])->inverseOf('posts');
 }
Esempio n. 2
0
 public function getLastThreads()
 {
     return $this->hasMany(Threads::className(), ['forum_id' => 'id'])->where(['forum_threads.state' => Threads::STATE_ACTIVE])->orderBy('flag DESC, updated_at DESC')->limit(3)->inverseOf('forum');
 }