/** * @param int $userId * @return Board[] */ public function getThreadChats($userId = null) { return $this->hasMany(Thread::className(), ['id' => 'thread_chat_id'])->viaTable('cp_users_chat_rights', ['chat_rights_id' => 'id'], function ($query) use($userId) { if ($userId != null && is_numeric($userId)) { $query->andWhere(['user_id' => $userId]); } }); }
public function getThreads() { return $this->hasMany(Thread::className(), ['id' => 'thread_id'])->viaTable('bans_threads', ['bans_settings_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getThreads() { return $this->hasMany(Thread::className(), ['category_id' => 'id']); }
public function getThreads() { return $this->hasMany(Thread::className(), ['posts_settings_id' => 'id']); }
public function getThreads() { return $this->hasMany(Thread::className(), ['id' => 'thread_id'])->viaTable('threads_tags', ['tag_id' => 'id']); }